Package com.itextpdf.text.pdf.events
Class IndexEvents
java.lang.Object
com.itextpdf.text.pdf.PdfPageEventHelper
com.itextpdf.text.pdf.events.IndexEvents
- All Implemented Interfaces:
PdfPageEvent
Class for an index.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Comparator<IndexEvents.Entry> Comparator for sorting the indexprivate longindexcounterprivate List<IndexEvents.Entry> the list for the index entrykeeps the indextag with the pagenumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate an index entry.voidCreate an index entry.voidCreate an index entry.Create an index entry.Create an index entry.Create an index entry.Returns the sorted list with the entries and the collected page numbers.voidonGenericTag(PdfWriter writer, Document document, Rectangle rect, String text) All the text that is passed to this event, gets registered in the indexentry.voidsetComparator(Comparator<IndexEvents.Entry> aComparator) Set the comparator.Methods inherited from class com.itextpdf.text.pdf.PdfPageEventHelper
onChapter, onChapterEnd, onCloseDocument, onEndPage, onOpenDocument, onParagraph, onParagraphEnd, onSection, onSectionEnd, onStartPage
-
Field Details
-
indextag
keeps the indextag with the pagenumber -
indexcounter
private long indexcounterindexcounter -
indexentry
the list for the index entry -
comparator
Comparator for sorting the index
-
-
Constructor Details
-
IndexEvents
public IndexEvents()
-
-
Method Details
-
onGenericTag
All the text that is passed to this event, gets registered in the indexentry.- Specified by:
onGenericTagin interfacePdfPageEvent- Overrides:
onGenericTagin classPdfPageEventHelper- Parameters:
writer- thePdfWriterfor this documentdocument- the documentrect- theRectanglecontaining theChunktext- the text of the tag- See Also:
-
create
Create an index entry.- Parameters:
text- The text for the Chunk.in1- The first level.in2- The second level.in3- The third level.- Returns:
- Returns the Chunk.
-
create
Create an index entry.- Parameters:
text- The text for the Chunk.in1- The first level.- Returns:
- Returns the Chunk.
-
create
Create an index entry.- Parameters:
text- The text for the Chunk.in1- The first level.in2- The second level.- Returns:
- Returns the Chunk.
-
create
Create an index entry.- Parameters:
text- The text.in1- The first level.in2- The second level.in3- The third level.
-
create
Create an index entry.- Parameters:
text- The text.in1- The first level.
-
create
Create an index entry.- Parameters:
text- The text.in1- The first level.in2- The second level.
-
setComparator
Set the comparator.- Parameters:
aComparator- The comparator to set.
-
getSortedEntries
Returns the sorted list with the entries and the collected page numbers.- Returns:
- Returns the sorted list with the entries and the collected page numbers.
-