pdfHTML 6.1.0 API
iText.Html2pdf.Attach.Impl.OutlineHandler Class Reference

A OutlineHandler handles creating outlines for marks. More...

Public Member Functions

  OutlineHandler ()
  Creates an OutlineHandler with standard TagOutlineMarkExtractor. More...
 
virtual IOutlineMarkExtractor  GetMarkExtractor ()
  Get mark extractor. More...
 
virtual iText.Html2pdf.Attach.Impl.OutlineHandler  SetMarkExtractor (IOutlineMarkExtractor extractor)
  Set mark extractor. More...
 
virtual iText.Html2pdf.Attach.Impl.OutlineHandler  PutMarkPriorityMapping (String markName, int? priority)
  Put mark into priority mapping. More...
 
virtual iText.Html2pdf.Attach.Impl.OutlineHandler  PutAllMarksPriorityMappings (IDictionary< String, int? > mappings)
  Put all marks into priority mappings. More...
 
virtual ? int  GetMarkPriorityMapping (String markName)
  Gets the mark from priority mapping. More...
 
virtual bool  HasMarkPriorityMapping (String markName)
  Checks for tag in priority mapping. More...
 
virtual void  Reset ()
  Resets the current state so that this OutlineHandler is ready to process new document More...
 
virtual void  SetDestinationNamePrefix (String destinationNamePrefix)
  Sets the destination name prefix. More...
 
virtual String  GetDestinationNamePrefix ()
  Gets the destination name prefix. More...
 

Static Public Member Functions

static iText.Html2pdf.Attach.Impl.OutlineHandler  CreateStandardHandler ()
  Creates an OutlineHandler with standard TagOutlineMarkExtractor and predefined mappings. More...
 
static iText.Html2pdf.Attach.Impl.OutlineHandler  CreateHandler (IOutlineMarkExtractor extractor)
  Creates an OutlineHandler with custom iText.Html2pdf.Attach.IOutlineMarkExtractor More...
 

Package Functions

virtual String  GenerateUniqueDestinationName (IElementNode element)
  Generate the unique destination name. More...
 
virtual String  GenerateOutlineName (IElementNode element)
  Generate the outline name. More...
 
virtual iText.Html2pdf.Attach.Impl.OutlineHandler  AddOutlineAndDestToDocument (ITagWorker tagWorker, IElementNode element, ProcessorContext context)
  Adds the outline and the destination. More...
 
virtual iText.Html2pdf.Attach.Impl.OutlineHandler  SetDestinationToElement (ITagWorker tagWorker, IElementNode element)
  Sets the destination to element. More...
 

Package Attributes

PdfOutline  currentOutline
  The current outline. More...
 
LinkedList< Tuple2< String, PdfDictionary > >  destinationsInProcess
  The destinations in process. More...
 
LinkedList< int >  levelsInProcess = new LinkedList()
  The levels in process. More...
 
IOutlineMarkExtractor  markExtractor
  The mark extractor defines what part of element will be used to create outline More...
 

Detailed Description

A OutlineHandler handles creating outlines for marks.

A OutlineHandler handles creating outlines for marks. Marks are extracted via interface iText.Html2pdf.Attach.IOutlineMarkExtractor.

This class is not reusable and a new instance shall be created for every new conversion process.

Constructor & Destructor Documentation

◆ OutlineHandler()

iText.Html2pdf.Attach.Impl.OutlineHandler.OutlineHandler ( )
inline

Creates an OutlineHandler with standard TagOutlineMarkExtractor.

Member Function Documentation

◆ AddOutlineAndDestToDocument()

virtual iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.AddOutlineAndDestToDocument ( ITagWorker  tagWorker,
IElementNode  element,
ProcessorContext  context 
)
inlinepackagevirtual

Adds the outline and the destination.

Adds the outline and the destination. Adds the outline and its corresponding the destination to the PDF document if the priority mapping is set for the element.

Parameters
tagWorker the tag worker
element the element
context the processor context
Returns
the outline handler

◆ CreateHandler()

static iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.CreateHandler ( IOutlineMarkExtractor  extractor )
inlinestatic

Creates an OutlineHandler with custom iText.Html2pdf.Attach.IOutlineMarkExtractor

Parameters
extractor the mark extractor
Returns
the outline handler

◆ CreateStandardHandler()

static iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.CreateStandardHandler ( )
inlinestatic

Creates an OutlineHandler with standard TagOutlineMarkExtractor and predefined mappings.

Returns
the outline handler

◆ GenerateOutlineName()

virtual String iText.Html2pdf.Attach.Impl.OutlineHandler.GenerateOutlineName ( IElementNode  element )
inlinepackagevirtual

Generate the outline name.

Generate the outline name. This method is used in the AddOutlineAndDestToDocument(iText.Html2pdf.Attach.ITagWorker, iText.StyledXmlParser.Node.IElementNode, iText.Html2pdf.Attach.ProcessorContext) method. You can override this method to set your own way to generate the outline names.

Parameters
element the element
Returns
the unique destination name

◆ GenerateUniqueDestinationName()

virtual String iText.Html2pdf.Attach.Impl.OutlineHandler.GenerateUniqueDestinationName ( IElementNode  element )
inlinepackagevirtual

Generate the unique destination name.

Generate the unique destination name. The destination name is a unique identifier for the outline so it is generated for the outline in the AddOutlineAndDestToDocument(iText.Html2pdf.Attach.ITagWorker, iText.StyledXmlParser.Node.IElementNode, iText.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.

Parameters
element the element
Returns
the unique destination name

◆ GetDestinationNamePrefix()

virtual String iText.Html2pdf.Attach.Impl.OutlineHandler.GetDestinationNamePrefix ( )
inlinevirtual

Gets the destination name prefix.

Gets the destination name prefix. The destination name prefix serves as the prefix for the destination names created in the GenerateUniqueDestinationName(iText.StyledXmlParser.Node.IElementNode) method.

Returns
the destination name prefix

◆ GetMarkExtractor()

virtual IOutlineMarkExtractor iText.Html2pdf.Attach.Impl.OutlineHandler.GetMarkExtractor ( )
inlinevirtual

Get mark extractor.

Returns
the mark extractor

◆ GetMarkPriorityMapping()

virtual ? int iText.Html2pdf.Attach.Impl.OutlineHandler.GetMarkPriorityMapping ( String  markName )
inlinevirtual

Gets the mark from priority mapping.

Parameters
markName the mark name
Returns
the tag priority mapping

◆ HasMarkPriorityMapping()

virtual bool iText.Html2pdf.Attach.Impl.OutlineHandler.HasMarkPriorityMapping ( String  markName )
inlinevirtual

Checks for tag in priority mapping.

Parameters
markName the mark name
Returns
true, if the tag name is listed in the tag priorities mapping

◆ PutAllMarksPriorityMappings()

virtual iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.PutAllMarksPriorityMappings ( IDictionary< String, int? >  mappings )
inlinevirtual

Put all marks into priority mappings.

Parameters
mappings the mappings
Returns
the outline handler

◆ PutMarkPriorityMapping()

virtual iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.PutMarkPriorityMapping ( String  markName,
int?  priority 
)
inlinevirtual

Put mark into priority mapping.

Parameters
markName the mark name
priority the priority
Returns
the outline handler

◆ Reset()

virtual void iText.Html2pdf.Attach.Impl.OutlineHandler.Reset ( )
inlinevirtual

Resets the current state so that this OutlineHandler is ready to process new document

◆ SetDestinationNamePrefix()

virtual void iText.Html2pdf.Attach.Impl.OutlineHandler.SetDestinationNamePrefix ( String  destinationNamePrefix )
inlinevirtual

Sets the destination name prefix.

Sets the destination name prefix. The destination name prefix serves as the prefix for the destination names created in the GenerateUniqueDestinationName(iText.StyledXmlParser.Node.IElementNode) method.

Parameters
destinationNamePrefix the destination name prefix

◆ SetDestinationToElement()

virtual iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.SetDestinationToElement ( ITagWorker  tagWorker,
IElementNode  element 
)
inlinepackagevirtual

Sets the destination to element.

Sets the destination to element. Sets the destination previously created in the AddOutlineAndDestToDocument(iText.Html2pdf.Attach.ITagWorker, iText.StyledXmlParser.Node.IElementNode, iText.Html2pdf.Attach.ProcessorContext) method to the tag worker element.

Parameters
tagWorker the tag worker
element the element
Returns
the outline handler

◆ SetMarkExtractor()

virtual iText.Html2pdf.Attach.Impl.OutlineHandler iText.Html2pdf.Attach.Impl.OutlineHandler.SetMarkExtractor ( IOutlineMarkExtractor  extractor )
inlinevirtual

Set mark extractor.

Parameters
extractor the mark extractor
Returns
the outline handler

Member Data Documentation

◆ currentOutline

PdfOutline iText.Html2pdf.Attach.Impl.OutlineHandler.currentOutline
package

The current outline.

◆ destinationsInProcess

LinkedList > iText.Html2pdf.Attach.Impl.OutlineHandler.destinationsInProcess
package
Initial value:
= new LinkedList
>()

The destinations in process.

◆ levelsInProcess

LinkedList iText.Html2pdf.Attach.Impl.OutlineHandler.levelsInProcess = new LinkedList()
package

The levels in process.

◆ markExtractor

IOutlineMarkExtractor iText.Html2pdf.Attach.Impl.OutlineHandler.markExtractor
package

The mark extractor defines what part of element will be used to create outline