Skip to content

Unable to add Paragraph to PDF #5

@BahaaIddinSharqawi

Description

@BahaaIddinSharqawi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions