Generate PDF


In this example we use iText library, we can download in this link.

Generate pdf

Then we add the library in libs file and we include this conde in your activity.

private void generateAndwritePDF() {

        // create a new document
        Document document = new Document();

        try {
            PdfWriter.getInstance(document, new FileOutputStream(mPdfFile));
            document.add(new Paragraph("Title"));


        } catch (Exception e) {



And we can generate pdf in android.

Example in Github

Leave a Reply

Your email address will not be published. Required fields are marked *