com.lawyer.pdfgeneration.AddParagraph.java Source code

Java tutorial

Introduction

Here is the source code for com.lawyer.pdfgeneration.AddParagraph.java

Source

package com.lawyer.pdfgeneration;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Font;
import com.itextpdf.text.Paragraph;

public class AddParagraph {

    public void addNewParagraph(Document document, Font smallBold) throws DocumentException {
        // TODO Auto-generated method stub

        Paragraph preface = new Paragraph();
        // We add one empty line
        // Lets write a big header
        //addEmptyLine(preface, 27);

        String SomeDataWhichIsDerived = pdfReaderFunction.rep1;
        // preface.add(new Paragraph("Generated Path of file"+OUTPUTFILE, catFont));
        //The new paragraph allows us to set the font of our choice
        //addEmptyLine(preface, 5);
        // Will create: Report generated by: _name, _date
        //  preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3smallBold));
        //  addEmptyLine(preface, 20);

        preface.add(new Paragraph(SomeDataWhichIsDerived, smallBold));
        // addEmptyLine(preface, 25);

        //  preface.add(new Paragraph("This document is a preliminary version and not subject to your license agreement or any other agreement with vogella.com ;-).",redFont));

        document.add(preface);
        // Start a new page

        document.newPage();

    }

}