DroidText icon indicating copy to clipboard operation
DroidText copied to clipboard

Unable to add Paragraph to PDF

Open BahaaIddinSharqawi opened this issue 6 years ago • 0 comments

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!!

BahaaIddinSharqawi avatar Apr 29 '19 10:04 BahaaIddinSharqawi