Class DefaultHtmlProcessor

java.lang.Object
com.itextpdf.html2pdf.attach.impl.DefaultHtmlProcessor
All Implemented Interfaces:
IHtmlProcessor

public class DefaultHtmlProcessor extends Object implements IHtmlProcessor
The default implementation to process HTML.
  • Constructor Details

    • DefaultHtmlProcessor

      public DefaultHtmlProcessor (ConverterProperties converterProperties)
      Instantiates a new default html processor.
      Parameters:
      converterProperties - the converter properties
  • Method Details

    • setConvertedRootElementProperties

      public static void setConvertedRootElementProperties (Map<String,String> cssProperties, ProcessorContext context, com.itextpdf.layout.IPropertyContainer propertyContainer)
      Sets properties to top-level layout elements converted from HTML. This enables features set by user via HTML converter API and also changes properties defaults to the ones specific to HTML-like behavior.
      Parameters:
      cssProperties - HTML document-level css properties.
      context - processor context specific to the current HTML conversion.
      propertyContainer - top-level layout element converted from HTML.
    • processElements

      public List processElements (com.itextpdf.styledxmlparser.node.INode root)
      Description copied from interface: IHtmlProcessor
      Parses HTML to add the content to a list of IElement objects.
      Specified by:
      processElements in interface IHtmlProcessor
      Parameters:
      root - the root node of the HTML that needs to be parsed
      Returns:
      the resulting list
    • processDocument

      public com.itextpdf.layout.Document processDocument (com.itextpdf.styledxmlparser.node.INode root, com.itextpdf.kernel.pdf.PdfDocument pdfDocument)
      Description copied from interface: IHtmlProcessor
      Parses HTML to add the content to a PdfDocument.
      Specified by:
      processDocument in interface IHtmlProcessor
      Parameters:
      root - the root node of the HTML that needs to be parsed
      pdfDocument - the PdfDocument instance
      Returns:
      a Document instance