Reputation: 2051
How to add image in a pdf using DroidText
I have tried the following code -
Document document = new Document();
File f=new File(Environment.getExternalStorageDirectory(), "SimpleImages.pdf");
PdfWriter.getInstance(document,new FileOutputStream(f));
document.open();
document.add(new Paragraph("Simple Image"));
Image image =Image.getInstance("file:///mnt/sdcard/img.png");
document.add(image);
document.close();
Upvotes: 3
Views: 5170
Reputation: 19
You Can Do It Like this.It is working
Image image = Image.getInstance ("file:///mnt/sdcard/Wallpapers/i_love_you.jpg"); document.add(image);
Upvotes: 0