Class PdfPageEventHelper
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Helps the use of PdfPageEvent by implementing all the interface methods. A class can extend PdfPageEventHelper and only implement the needed methods. @author Paulo Soares (psoares@consiste.pt)
public class PdfPageEventHelper : IPdfPageEvent
- Inheritance
-
PdfPageEventHelper
- Implements
- Derived
- Inherited Members
Constructors
PdfPageEventHelper()
public PdfPageEventHelper()
Methods
OnChapter(PdfWriter, Document, float, Paragraph)
Called when a Chapter is written. position will hold the height at which the chapter will be written to.
public virtual void OnChapter(PdfWriter writer, Document document, float paragraphPosition, Paragraph title)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
paragraphPosition
floatthe position the chapter will be written to
title
Paragraphthe title of the Chapter
OnChapterEnd(PdfWriter, Document, float)
Called when the end of a Chapter is reached. position will hold the height of the end of the chapter.
public virtual void OnChapterEnd(PdfWriter writer, Document document, float paragraphPosition)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
paragraphPosition
floatthe position of the end of the chapter.
OnCloseDocument(PdfWriter, 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 virtual void OnCloseDocument(PdfWriter writer, Document document)
Parameters
OnEndPage(PdfWriter, Document)
Called when a page is finished, just before being written to the document.
public virtual void OnEndPage(PdfWriter writer, Document document)
Parameters
OnGenericTag(PdfWriter, Document, Rectangle, string)
Called when a Chunk with a generic tag is written. It is usefull to pinpoint the Chunk location to generate bookmarks, for example.
public virtual void OnGenericTag(PdfWriter writer, Document document, Rectangle rect, string text)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
rect
Rectanglethe Rectangle containing the Chunk
text
stringthe text of the tag
OnOpenDocument(PdfWriter, Document)
Called when the document is opened.
public virtual void OnOpenDocument(PdfWriter writer, Document document)
Parameters
OnParagraph(PdfWriter, Document, float)
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 virtual void OnParagraph(PdfWriter writer, Document document, float paragraphPosition)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
paragraphPosition
floatthe position the paragraph will be written to
OnParagraphEnd(PdfWriter, Document, float)
Called when a Paragraph is written. paragraphPosition will hold the height of the end of the paragraph.
public virtual void OnParagraphEnd(PdfWriter writer, Document document, float paragraphPosition)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
paragraphPosition
floatthe position of the end of the paragraph
OnSection(PdfWriter, Document, float, int, Paragraph)
Called when a Section is written. position will hold the height at which the section will be written to.
public virtual void OnSection(PdfWriter writer, Document document, float paragraphPosition, int depth, Paragraph title)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
paragraphPosition
floatthe position the chapter will be written to
depth
inttitle
Paragraphthe title of the Chapter
OnSectionEnd(PdfWriter, Document, float)
Called when the end of a Section is reached. position will hold the height of the section end.
public virtual void OnSectionEnd(PdfWriter writer, Document document, float paragraphPosition)
Parameters
writer
PdfWriterthe PdfWriter for this document
document
Documentthe document
paragraphPosition
floatthe position of the end of the section
OnStartPage(PdfWriter, 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.
public virtual void OnStartPage(PdfWriter writer, Document document)