Package com.itextpdf.html2pdf.attach
Class ProcessorContext
java.lang.Object
com.itextpdf.html2pdf.attach.ProcessorContext
Keeps track of the context of the processor.
-
Constructor Summary
ConstructorsConstructorDescriptionProcessorContext(ConverterProperties converterProperties) Instantiates a newProcessorContextinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTemporaryFont(com.itextpdf.io.font.FontProgram fontProgram, String encoding, String alias) Add temporary font from @font-face.voidaddTemporaryFont(com.itextpdf.io.font.FontProgram fontProgram, String encoding, String alias, com.itextpdf.layout.font.Range unicodeRange) Add temporary font from @font-face.voidaddTemporaryFont(com.itextpdf.layout.font.FontInfo fontInfo, String alias) Add temporary font from @font-face.voidEnd the processing Svg StateGets 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.com.itextpdf.kernel.pdf.PdfConformanceGet the PDF document conformance.Gets the CSS applier factory.Gets the CSS context.com.itextpdf.styledxmlparser.css.CssStyleSheetGets the CSS style sheet.com.itextpdf.styledxmlparser.css.media.MediaDeviceDescriptionGets the device description.com.itextpdf.commons.utils.DIContainerGets the DIContainer.com.itextpdf.layout.font.FontProviderGets the font provider.Gets the form field name resolver.intGets maximum number of layouts.Gets the link context.Gets html meta info container.Gets the outline handler.com.itextpdf.kernel.pdf.PdfDocumentGets the PDF document.Gets the radio check resolver.com.itextpdf.styledxmlparser.resolver.resource.ResourceResolverGets the resource resolver.getState()Gets the state.Gets the tag worker factory.com.itextpdf.layout.font.FontSetGets the temporary set of fonts.booleanhasFonts()Check fonts in font provider and temporary font set.booleancheck if continuous container is enabled.booleanChecks if is an AcroForm needs to be created.booleanChecks if immediateFlush is setbooleanCheck if the processor is currently processing an inline svgvoidreset()Resets the context.voidreset(com.itextpdf.kernel.pdf.PdfDocument pdfDocument) Resets the context, and assigns a new PDF document.voidsetCssStyleSheet(com.itextpdf.styledxmlparser.css.CssStyleSheet cssStyleSheet) Sets the CSS style sheet.voidsetFontProvider(com.itextpdf.layout.font.FontProvider fontProvider) Sets the font provider.voidsetMetaInfo(com.itextpdf.commons.actions.contexts.IMetaInfo metaInfo) Sets IMetaInfo to processor context.voidSet the processor to processing Inline Svg state
-
Constructor Details
-
ProcessorContext
Instantiates a newProcessorContextinstance.- Parameters:
-
converterProperties- aConverterPropertiesinstance
-
-
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
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
-
getConformance
public com.itextpdf.kernel.pdf.PdfConformance getConformance()Get the PDF document conformance.- Returns:
-
the
PdfConformance
-
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
Gets the tag worker factory.- Returns:
- the tag worker factory
-
getCssApplierFactory
Gets the CSS applier factory.- Returns:
- the CSS applier factory
-
getCssContext
Gets the CSS context.- Returns:
- the CSS context
-
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
Gets the form field name resolver.- Returns:
- the form field name resolver
-
getRadioCheckResolver
Gets the radio check resolver.- Returns:
- the radio check resolver
-
getOutlineHandler
Gets the outline handler.- Returns:
- the outline handler
-
addTemporaryFont
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
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
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
-
setCssStyleSheet
public void setCssStyleSheet(com.itextpdf.styledxmlparser.css.CssStyleSheet cssStyleSheet) Sets the CSS style sheet. Style sheet is used to apply CSS statements to elements.- Parameters:
-
cssStyleSheet- the CSS style sheet
-
getCssStyleSheet
public com.itextpdf.styledxmlparser.css.CssStyleSheet getCssStyleSheet()Gets the CSS style sheet. Style sheet is used to apply CSS statements to elements.- Returns:
- the CSS style sheet
-
getDIContainer
public com.itextpdf.commons.utils.DIContainer getDIContainer()Gets the DIContainer.- Returns:
- the DIContainer.
-