|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.pdf.events.PdfPageEventForwarder
public class PdfPageEventForwarder
If you want to add more than one page event to a PdfWriter, you have to construct a PdfPageEventForwarder, add the different events to this object and add the forwarder to the PdfWriter.
| Field Summary | |
|---|---|
protected ArrayList |
events
ArrayList containing all the PageEvents that have to be executed. |
| Constructor Summary | |
|---|---|
PdfPageEventForwarder()
|
|
| Method Summary | |
|---|---|
void |
addPageEvent(PdfPageEvent event)
Add a page event to the forwarder. |
void |
onChapter(PdfWriter writer,
Document document,
float paragraphPosition,
Paragraph title)
Called when a Chapter is written. |
void |
onChapterEnd(PdfWriter writer,
Document document,
float position)
Called when the end of a Chapter is reached. |
void |
onCloseDocument(PdfWriter writer,
Document document)
Called when the document is closed. |
void |
onEndPage(PdfWriter writer,
Document document)
Called when a page is finished, just before being written to the document. |
void |
onGenericTag(PdfWriter writer,
Document document,
Rectangle rect,
String text)
Called when a Chunk with a generic tag is written. |
void |
onOpenDocument(PdfWriter writer,
Document document)
Called when the document is opened. |
void |
onParagraph(PdfWriter writer,
Document document,
float paragraphPosition)
Called when a Paragraph is written. |
void |
onParagraphEnd(PdfWriter writer,
Document document,
float paragraphPosition)
Called when a Paragraph is written. |
void |
onSection(PdfWriter writer,
Document document,
float paragraphPosition,
int depth,
Paragraph title)
Called when a Section is written. |
void |
onSectionEnd(PdfWriter writer,
Document document,
float position)
Called when the end of a Section is reached. |
void |
onStartPage(PdfWriter writer,
Document document)
Called when a page is initialized. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList events
| Constructor Detail |
|---|
public PdfPageEventForwarder()
| Method Detail |
|---|
public void addPageEvent(PdfPageEvent event)
event - an event that has to be added to the forwarder.
public void onOpenDocument(PdfWriter writer,
Document document)
onOpenDocument in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the document
public void onStartPage(PdfWriter writer,
Document document)
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.
onStartPage in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the document
public void onEndPage(PdfWriter writer,
Document document)
onEndPage in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the document
public void onCloseDocument(PdfWriter writer,
Document document)
Note that this method is called with the page number equal to the last page plus one.
onCloseDocument in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the document
public void onParagraph(PdfWriter writer,
Document document,
float paragraphPosition)
paragraphPosition will hold the height at which the
paragraph will be written to. This is useful to insert bookmarks with
more control.
onParagraph in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentparagraphPosition - the position the paragraph will be written to
public void onParagraphEnd(PdfWriter writer,
Document document,
float paragraphPosition)
paragraphPosition will hold the height of the end of the
paragraph.
onParagraphEnd in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentparagraphPosition - the position of the end of the paragraph
public void onChapter(PdfWriter writer,
Document document,
float paragraphPosition,
Paragraph title)
position will hold the height at which the chapter will be
written to.
onChapter in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentparagraphPosition - the position the chapter will be written totitle - the title of the Chapter
public void onChapterEnd(PdfWriter writer,
Document document,
float position)
position will hold the height of the end of the chapter.
onChapterEnd in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentposition - the position of the end of the chapter.
public void onSection(PdfWriter writer,
Document document,
float paragraphPosition,
int depth,
Paragraph title)
position will hold the height at which the section will be
written to.
onSection in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentparagraphPosition - the position the section will be written todepth - the number depth of the Sectiontitle - the title of the section
public void onSectionEnd(PdfWriter writer,
Document document,
float position)
position will hold the height of the section end.
onSectionEnd in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentposition - the position of the end of the section
public void onGenericTag(PdfWriter writer,
Document document,
Rectangle rect,
String text)
Chunk with a generic tag is written.
It is usefull to pinpoint the Chunk location to generate
bookmarks, for example.
onGenericTag in interface PdfPageEventwriter - the PdfWriter for this documentdocument - the documentrect - the Rectangle containing the Chunk
text - the text of the tag
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||