PdfPageEvent: page end : Document Page Event « PDF RTF « Java

PdfPageEvent: page end

PdfPageEvent: page end
import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfPageEventHelper;
import com.lowagie.text.pdf.PdfWriter;

public class OnEndPageEventPDF extends PdfPageEventHelper {
    public static void main(String[] args)
        Document document = new Document(PageSize.A4, 50, 50, 70, 70);
        try {
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("OnEndPageEventPDF.pdf"));
            writer.setPageEvent(new OnEndPageEventPDF());
            document.add(new Paragraph("text"));
        catch (Exception de) {
    public void onEndPage(PdfWriter writer, Document document) {
       System.out.println("on page end event call back");



itext.zip( 1,748 k)

Related examples in the same category

1.Using Pdf event to build the Pdf documentUsing Pdf event to build the Pdf document
2.PdfEvents: on generic tags, on chapterPdfEvents: on generic tags, on chapter
3.PdfPageEvent: on ParagraphPdfPageEvent: on Paragraph
4.Document Page Event: document open, close, page start and endDocument Page Event: document open, close, page start and end