Table of Contents

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 PdfWriter

the PdfWriter for this document

document Document

the document

paragraphPosition float

the position the chapter will be written to

title Paragraph

the 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 PdfWriter

the PdfWriter for this document

document Document

the document

paragraphPosition float

the 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

writer PdfWriter

the PdfWriter for this document

document Document

the document

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

writer PdfWriter

the PdfWriter for this document

document Document

the document

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 PdfWriter

the PdfWriter for this document

document Document

the document

rect Rectangle

the Rectangle containing the Chunk

text string

the text of the tag

OnOpenDocument(PdfWriter, Document)

Called when the document is opened.

public virtual void OnOpenDocument(PdfWriter writer, Document document)

Parameters

writer PdfWriter

the PdfWriter for this document

document Document

the document

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 PdfWriter

the PdfWriter for this document

document Document

the document

paragraphPosition float

the 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 PdfWriter

the PdfWriter for this document

document Document

the document

paragraphPosition float

the 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 PdfWriter

the PdfWriter for this document

document Document

the document

paragraphPosition float

the position the chapter will be written to

depth int
title Paragraph

the 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 PdfWriter

the PdfWriter for this document

document Document

the document

paragraphPosition float

the 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)

Parameters

writer PdfWriter

the PdfWriter for this document

document Document

the document