How to add paragraph to my pdf using DroidText?
I tried with the following code to add paragraph:
Document doc = new Document();
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "sample.pdf");
FileOutputStream fOut = new FileOutputStream(file);
PdfWriter.getInstance(doc, fOut);
doc.open();
Paragraph p1 = new Paragraph("My first PDF");
Font paraFont = new Font(Font.COURIER);
p1.setAlignment(Paragraph.ALIGN_CENTER);
p1.setFont(paraFont);
doc.add(p1);
doc.close();
But the paragraph not added to pdf document!!
How to add paragraph to my pdf using DroidText?
I tried with the following code to add paragraph:
Document doc = new Document();File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "sample.pdf");FileOutputStream fOut = new FileOutputStream(file);PdfWriter.getInstance(doc, fOut);doc.open();Paragraph p1 = new Paragraph("My first PDF");Font paraFont = new Font(Font.COURIER);p1.setAlignment(Paragraph.ALIGN_CENTER);p1.setFont(paraFont);doc.add(p1);doc.close();But the paragraph not added to pdf document!!