Save This Page
Home » iText-src-2.1.3 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
public class: PdfPageEventHelper [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.PdfPageEventHelper

All Implemented Interfaces:
    PdfPageEvent

Direct Known Subclasses:
    IndexEvents, FieldPositioningEvents

Helps the use of PdfPageEvent by implementing all the interface methods. A class can extend PdfPageEventHelper and only implement the needed methods.

Note: do not use Document.add() inside a page event.

Method from com.lowagie.text.pdf.PdfPageEventHelper Summary:
onChapter,   onChapterEnd,   onCloseDocument,   onEndPage,   onGenericTag,   onOpenDocument,   onParagraph,   onParagraphEnd,   onSection,   onSectionEnd,   onStartPage
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.PdfPageEventHelper Detail:
 public  void onChapter(PdfWriter writer,
    Document document,
    float paragraphPosition,
    Paragraph title) 
    Called when a Chapter is written.

    position will hold the height at which the chapter will be written to.

 public  void onChapterEnd(PdfWriter writer,
    Document document,
    float position) 
    Called when the end of a Chapter is reached.

    position will hold the height of the end of the chapter.

 public  void onCloseDocument(PdfWriter writer,
    Document document) 
    Called when the document is closed.

    Note that this method is called with the page number equal to the last page plus one.

 public  void onEndPage(PdfWriter writer,
    Document document) 
    Called when a page is finished, just before being written to the document.
 public  void onGenericTag(PdfWriter writer,
    Document document,
    Rectangle rect,
    String text) 
    Called when a Chunk with a generic tag is written.

    It is useful to pinpoint the Chunk location to generate bookmarks, for example.

 public  void onOpenDocument(PdfWriter writer,
    Document document) 
    Called when the document is opened.
 public  void onParagraph(PdfWriter writer,
    Document document,
    float paragraphPosition) 
    Called when a Paragraph is written.

    paragraphPosition will hold the height at which the paragraph will be written to. This is useful to insert bookmarks with more control.

 public  void onParagraphEnd(PdfWriter writer,
    Document document,
    float paragraphPosition) 
    Called when a Paragraph is written.

    paragraphPosition will hold the height of the end of the paragraph.

 public  void onSection(PdfWriter writer,
    Document document,
    float paragraphPosition,
    int depth,
    Paragraph title) 
    Called when a Section is written.

    position will hold the height at which the section will be written to.

 public  void onSectionEnd(PdfWriter writer,
    Document document,
    float position) 
    Called when the end of a Section is reached.

    position will hold the height of the section end.

 public  void onStartPage(PdfWriter writer,
    Document document) 
    Called when a page is initialized.

    Note that if even if a page is not written this method is still called. It is preferable to use onEndPage to avoid infinite loops.