Reputation: 928
I am trying to create a PDF file by inserting some text into it with a proper structure in Android.
Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream("urgentz.pdf"));
doc.open();
Image image = Image.getInstance ("urgentzImageahslkdhaosd.jpg");
doc.add(new Paragraph("Your text blah bleh"));
doc.add(image);
doc.close();
The above code does not work.
Upvotes: 1
Views: 4162
Reputation: 1675
Without seeing stacktrace I can only guess what's wrong. You might find these questions useful:
Some ideas:
/mnt/sdcard/<YourFolderHere>/somefile.pdf
and make sure you have defined android.permission.WRITE_EXTERNAL_STORAGE
in AndroidManifest.xmliText
Upvotes: 1