Class ProcessorContext

java.lang.Object
com.itextpdf.html2pdf.attach.ProcessorContext

public class ProcessorContext extends Object
Keeps track of the context of the processor.
  • Constructor Details

  • Method Details

    • getLimitOfLayouts

      public int getLimitOfLayouts()
      Gets maximum number of layouts.
      Returns:
      layouts limit
    • setFontProvider

      public void setFontProvider (com.itextpdf.layout.font.FontProvider fontProvider)
      Sets the font provider.
      Parameters:
      fontProvider - the new font provider
    • getState

      public State getState()
      Gets the state.
      Returns:
      the state
    • getPdfDocument

      public com.itextpdf.kernel.pdf.PdfDocument getPdfDocument()
      Gets the PDF document. If the PDF document is not set, null is returned.
      Returns:
      the PDF document or null
    • getConformanceLevel

      public com.itextpdf.kernel.pdf.IConformanceLevel getConformanceLevel()
      Get the PDF document conformance level if specified.
      Returns:
      the PdfAConformanceLevel will be null if the processing result won't follow PDF/A strictness
    • getFontProvider

      public com.itextpdf.layout.font.FontProvider getFontProvider()
      Gets the font provider.
      Returns:
      the font provider
    • getTempFonts

      public com.itextpdf.layout.font.FontSet getTempFonts()
      Gets the temporary set of fonts.
      Returns:
      the set of fonts
    • getResourceResolver

      public com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver getResourceResolver()
      Gets the resource resolver.
      Returns:
      the resource resolver
    • getDeviceDescription

      public com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription getDeviceDescription()
      Gets the device description.
      Returns:
      the device description
    • getTagWorkerFactory

      public ITagWorkerFactory getTagWorkerFactory()
      Gets the tag worker factory.
      Returns:
      the tag worker factory
    • getCssApplierFactory

      public ICssApplierFactory getCssApplierFactory()
      Gets the CSS applier factory.
      Returns:
      the CSS applier factory
    • getCssContext

      public CssContext getCssContext()
      Gets the CSS context.
      Returns:
      the CSS context
    • getLinkContext

      public LinkContext getLinkContext()
      Gets the link context.
      Returns:
      the link context
    • isCreateAcroForm

      public boolean isCreateAcroForm()
      Checks if is an AcroForm needs to be created.
      Returns:
      true, an AcroForm should be created
    • getFormFieldNameResolver

      public FormFieldNameResolver getFormFieldNameResolver()
      Gets the form field name resolver.
      Returns:
      the form field name resolver
    • getRadioCheckResolver

      public RadioCheckResolver getRadioCheckResolver()
      Gets the radio check resolver.
      Returns:
      the radio check resolver
    • getOutlineHandler

      public OutlineHandler getOutlineHandler()
      Gets the outline handler.
      Returns:
      the outline handler
    • addTemporaryFont

      public void addTemporaryFont (com.itextpdf.layout.font.FontInfo fontInfo, String alias)
      Add temporary font from @font-face.
      Parameters:
      fontInfo - the font info
      alias - the alias
    • addTemporaryFont

      public void addTemporaryFont (com.itextpdf.io.font.FontProgram fontProgram, String encoding, String alias)
      Add temporary font from @font-face.
      Parameters:
      fontProgram - the font program
      encoding - the encoding
      alias - the alias
    • addTemporaryFont

      public void addTemporaryFont (com.itextpdf.io.font.FontProgram fontProgram, String encoding, String alias, com.itextpdf.layout.font.Range unicodeRange)
      Add temporary font from @font-face.
      Parameters:
      fontProgram - the font program
      encoding - the encoding
      alias - the alias
      unicodeRange - the unicode range
    • hasFonts

      public boolean hasFonts()
      Check fonts in font provider and temporary font set.
      Returns:
      true, if there is at least one font either in FontProvider or temporary FontSet.
      See Also:
    • reset

      public void reset()
      Resets the context.
    • reset

      public void reset (com.itextpdf.kernel.pdf.PdfDocument pdfDocument)
      Resets the context, and assigns a new PDF document.
      Parameters:
      pdfDocument - the new PDF document for the context
    • getBaseUri

      public String getBaseUri()
      Gets the baseURI: the URI which has been set manually or the directory of the html file in case when baseURI hasn't been set manually.
      Returns:
      the baseUri
    • isImmediateFlush

      public boolean isImmediateFlush()
      Checks if immediateFlush is set
      Returns:
      true if immediateFlush is set, false if not.
    • getMetaInfoContainer

      public HtmlMetaInfoContainer getMetaInfoContainer()
      Gets html meta info container.

      Meta info will be used to determine event origin.

      Returns:
      html meta info container
    • setMetaInfo

      public void setMetaInfo (com.itextpdf.commons.actions.contexts.IMetaInfo metaInfo)
      Sets IMetaInfo to processor context.
      Parameters:
      metaInfo - the IMetaInfo object
    • isProcessingInlineSvg

      public boolean isProcessingInlineSvg()
      Check if the processor is currently processing an inline svg
      Returns:
      True if the processor is processing an inline Svg, false otherwise.
    • startProcessingInlineSvg

      public void startProcessingInlineSvg()
      Set the processor to processing Inline Svg state
    • endProcessingInlineSvg

      public void endProcessingInlineSvg()
      End the processing Svg State
    • isContinuousContainerEnabled

      public boolean isContinuousContainerEnabled()
      check if continuous container is enabled.
      Returns:
      true if enabled, false otherwise