public class OutlineHandler extends Object
OutlineHandler
handles creating outlines for tags.
This class is not reusable and a new instance shall be created for every new conversion process.
Constructor and Description |
---|
OutlineHandler() |
Modifier and Type | Method and Description |
---|---|
static OutlineHandler |
createStandardHandler()
Creates an OutlineHandler with standard predefined mappings.
|
protected String |
generateUniqueDestinationName(com.itextpdf.styledxmlparser.node.IElementNode element)
Generate the unique destination name.
|
protected String |
generateUniqueOutlineName(com.itextpdf.styledxmlparser.node.IElementNode element)
Generate the unique outline name.
|
String |
getDestinationNamePrefix()
Gets the destination name prefix.
|
Integer |
getTagPriorityMapping(String tagName)
Gets the tag priority mapping.
|
boolean |
hasTagPriorityMapping(String tagName)
Checks for tag priority mapping.
|
OutlineHandler |
putAllTagPriorityMappings(Map<String,Integer> mappings)
Put all tag priority mappings.
|
OutlineHandler |
putTagPriorityMapping(String tagName, Integer priority)
Put tag priority mapping.
|
void |
reset()
Resets the current state so that this OutlineHandler is ready to process new document
|
void |
setDestinationNamePrefix(String destinationNamePrefix)
Sets the destination name prefix.
|
public static OutlineHandler createStandardHandler()
public OutlineHandler putTagPriorityMapping(String tagName, Integer priority)
tagName
- the tag name
priority
- the priority
public OutlineHandler putAllTagPriorityMappings(Map<String,Integer> mappings)
mappings
- the mappings
public Integer getTagPriorityMapping(String tagName)
tagName
- the tag name
public boolean hasTagPriorityMapping(String tagName)
tagName
- the tag name
public void reset()
OutlineHandler
is ready to process new document
public void setDestinationNamePrefix(String destinationNamePrefix)
generateUniqueDestinationName(com.itextpdf.styledxmlparser.node.IElementNode)
method.
destinationNamePrefix
- the destination name prefix
public String getDestinationNamePrefix()
generateUniqueDestinationName(com.itextpdf.styledxmlparser.node.IElementNode)
method.
protected String generateUniqueDestinationName(com.itextpdf.styledxmlparser.node.IElementNode element)
addOutlineAndDestToDocument(com.itextpdf.html2pdf.attach.ITagWorker, com.itextpdf.styledxmlparser.node.IElementNode, com.itextpdf.html2pdf.attach.ProcessorContext)
method. You can override this method to set your own way to generate the destination names, to avoid the destination name conflicts when merging several PDF files created by html2pdf.
element
- the element
protected String generateUniqueOutlineName(com.itextpdf.styledxmlparser.node.IElementNode element)
addOutlineAndDestToDocument(com.itextpdf.html2pdf.attach.ITagWorker, com.itextpdf.styledxmlparser.node.IElementNode, com.itextpdf.html2pdf.attach.ProcessorContext)
method. You can override this method to set your own way to generate the outline names.
element
- the element
Copyright © 1998–2020 iText Group NV. All rights reserved.