Class ConverterProperties
HtmlConverter
.
-
Constructor Summary
ConstructorDescriptionInstantiates a newConverterProperties
instance.Instantiates a newConverterProperties
instance based on anotherConverterProperties
instance (copy constructor). -
Method Summary
Modifier and TypeMethodDescriptionGets the base URI.Gets the encoding charset.Gets the CSS applier factory.com.itextpdf.kernel.pdf.PdfOutputIntent
Gets pdf document output intent (final destination device) to reproduce the color in the PDF.com.itextpdf.layout.font.FontProvider
Gets the font provider.int
Gets maximum number of layouts.com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription
Gets the media device description.Gets the outline handler.com.itextpdf.kernel.pdf.PdfAConformance
Gets the generation and strictness level of the PDF/A that must be followed.com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever
Gets the resource retriever.Gets the TagWorkerFactory instance.boolean
check if continuous container is enabled.boolean
Check if the createAcroForm flag is set.boolean
Checks if immediateFlush is set.setBaseUri
(String baseUri) Sets the base URI.setCharset
(String charset) Sets the encoding charset.setContinuousContainerEnabled
(boolean value) Sets continuous container support.setCreateAcroForm
(boolean createAcroForm) Sets the createAcroForm value.setCssApplierFactory
(ICssApplierFactory cssApplierFactory) Sets the CSS applier factory.setDocumentOutputIntent
(com.itextpdf.kernel.pdf.PdfOutputIntent outputIntent) Sets pdf document output intent (final destination device) to reproduce the color in the PDF.setEventMetaInfo
(com.itextpdf.commons.actions.contexts.IMetaInfo metaInfo) Sets html meta info.setFontProvider
(com.itextpdf.layout.font.FontProvider fontProvider) Sets the font provider.setImmediateFlush
(boolean immediateFlush) Set the immediate flush property of the layout document.setLimitOfLayouts
(int limitOfLayouts) Sets maximum number of layouts.setMediaDeviceDescription
(com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription mediaDeviceDescription) Sets the media device description.setOutlineHandler
(OutlineHandler outlineHandler) Sets the outline handler.setPdfAConformance
(com.itextpdf.kernel.pdf.PdfAConformance conformance) Sets the generation and strictness level of the PDF/A that must be followed.setResourceRetriever
(com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever resourceRetriever) Sets the resource retriever.setTagWorkerFactory
(ITagWorkerFactory tagWorkerFactory) Sets the TagWorkerFactory.
-
Constructor Details
-
ConverterProperties
public ConverterProperties()Instantiates a newConverterProperties
instance. -
ConverterProperties
Instantiates a newConverterProperties
instance based on anotherConverterProperties
instance (copy constructor).- Parameters:
-
other
- the otherConverterProperties
instance
-
-
Method Details
-
getMediaDeviceDescription
public com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription getMediaDeviceDescription()Gets the media device description.The properties of the multimedia device are taken into account when creating the SVG and when processing the properties of the СSS.
- Returns:
- the media device description
-
setMediaDeviceDescription
public ConverterProperties setMediaDeviceDescription(com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription mediaDeviceDescription) Sets the media device description.The properties of the multimedia device are taken into account when creating the SVG and when processing the properties of the СSS.
- Parameters:
-
mediaDeviceDescription
- the media device description - Returns:
-
the
ConverterProperties
instance
-
getFontProvider
public com.itextpdf.layout.font.FontProvider getFontProvider()Gets the font provider.Please note that
FontProvider
instances cannot be reused across several documents and thus as soon as you set this property, thisConverterProperties
instance becomes only useful for a single HTML conversion.- Returns:
- the font provider
-
setFontProvider
Sets the font provider.Please note that
FontProvider
instances cannot be reused across several documents and thus as soon as you set this property, thisConverterProperties
instance becomes only useful for a single HTML conversion.- Parameters:
-
fontProvider
- the font provider - Returns:
-
the
ConverterProperties
instance
-
getLimitOfLayouts
public int getLimitOfLayouts()Gets maximum number of layouts.- Returns:
- layouts limit
-
setLimitOfLayouts
Sets maximum number of layouts.- Parameters:
-
limitOfLayouts
- layouts limit - Returns:
-
the
ConverterProperties
instance
-
getTagWorkerFactory
Gets the TagWorkerFactory instance.The tagWorkerFactory is used to create
ITagWorker
, which in turn are used to convert the HTML tags to the PDF elements.- Returns:
- the TagWorkerFactory
-
setTagWorkerFactory
Sets the TagWorkerFactory.The tagWorkerFactory is used to create
ITagWorker
, which in turn are used to convert the HTML tags to the PDF elements.- Parameters:
-
tagWorkerFactory
- the TagWorkerFactory - Returns:
-
the
ConverterProperties
instance
-
getCssApplierFactory
Gets the CSS applier factory.The cssApplierFactory is used to create
ICssApplier
, which in turn are used to convert the CSS properties to the PDF properties.- Returns:
- the CSS applier factory
-
setCssApplierFactory
Sets the CSS applier factory.The cssApplierFactory is used to create
ICssApplier
, which in turn are used to convert the CSS properties to the PDF properties.- Parameters:
-
cssApplierFactory
- the CSS applier factory - Returns:
-
the
ConverterProperties
instance
-
getBaseUri
Gets the base URI.Base URI is used to resolve other URI.
- Returns:
- the base URI
-
setBaseUri
Sets the base URI.Base URI is used to resolve other URI.
- Parameters:
-
baseUri
- the base URI - Returns:
-
the
ConverterProperties
instance
-
getResourceRetriever
public com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever getResourceRetriever()Gets the resource retriever.The resourceRetriever is used to retrieve data from resources by URL.
- Returns:
- the resource retriever
-
setResourceRetriever
public ConverterProperties setResourceRetriever(com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever resourceRetriever) Sets the resource retriever.The resourceRetriever is used to retrieve data from resources by URL.
- Parameters:
-
resourceRetriever
- the resource retriever - Returns:
-
the
ConverterProperties
instance
-
isCreateAcroForm
public boolean isCreateAcroForm()Check if the createAcroForm flag is set.If createAcroForm is set, then when the form is encountered in HTML, AcroForm will be created, otherwise a visually identical, but not functional element will be created. Please bare in mind that the created Acroform may visually differ a bit from the HTML one.
- Returns:
- the createAcroForm flag
-
setCreateAcroForm
Sets the createAcroForm value.If createAcroForm is set, then when the form is encountered in HTML, AcroForm will be created, otherwise a visually identical, but not functional element will be created. Please bare in mind that the created Acroform may visually differ a bit from the HTML one.
When enabling this acroform creation, it will disable the immediateFlushing property.
- Parameters:
-
createAcroForm
- true if an AcroForm needs to be created - Returns:
-
the
ConverterProperties
instance
-
getOutlineHandler
Gets the outline handler.If outlineHandler is specified, then outlines will be created in the PDF for HTML tags specified in outlineHandler.
Please note that
OutlineHandler
is not thread safe, thus as soon as you have set this property, thisConverterProperties
instance cannot be used in converting multiple HTMLs simultaneously.- Returns:
- the outline handler
-
setOutlineHandler
Sets the outline handler.If outlineHandler is specified, then outlines will be created in the PDF for HTML tags specified in outlineHandler.
Please note that
OutlineHandler
is not thread safe, thus as soon as you have set this property, thisConverterProperties
instance cannot be used in converting multiple HTMLs simultaneously.- Parameters:
-
outlineHandler
- the outline handler - Returns:
-
the
ConverterProperties
instance
-
getCharset
Gets the encoding charset.Charset is used to correctly decode an HTML file.
- Returns:
- the charset
-
setCharset
Sets the encoding charset.Charset is used to correctly decode an HTML file.
- Parameters:
-
charset
- the charset - Returns:
-
the
ConverterProperties
instance
-
setDocumentOutputIntent
public ConverterProperties setDocumentOutputIntent(com.itextpdf.kernel.pdf.PdfOutputIntent outputIntent) Sets pdf document output intent (final destination device) to reproduce the color in the PDF. Required parameter, when converting to pdf/a one have to specify an explicit output intent.Note, output intent isn't applicable for HtmlConverter#convertToElements methods (e.g.
HtmlConverter.convertToElements(InputStream, ConverterProperties)
)- Parameters:
-
outputIntent
- aPdfOutputIntent
instance - Returns:
-
the
ConverterProperties
instance
-
setPdfAConformance
Sets the generation and strictness level of the PDF/A that must be followed. Required parameter, when converting to pdf/a one have to specify an explicit pdf/a conformance.- Parameters:
-
conformance
- aPdfAConformance
constant - Returns:
-
the
ConverterProperties
instance
-
getDocumentOutputIntent
public com.itextpdf.kernel.pdf.PdfOutputIntent getDocumentOutputIntent()Gets pdf document output intent (final destination device) to reproduce the color in the PDF.Note, output intent isn't applicable for HtmlConverter#convertToElements methods (e.g.
HtmlConverter.convertToElements(InputStream, ConverterProperties)
)- Returns:
- pdf output intent
-
getPdfAConformance
public com.itextpdf.kernel.pdf.PdfAConformance getPdfAConformance()Gets the generation and strictness level of the PDF/A that must be followed.- Returns:
- pdf/a conformance
-
isImmediateFlush
public boolean isImmediateFlush()Checks if immediateFlush is set.This is used for
HtmlConverter.convertToDocument(java.lang.String, com.itextpdf.kernel.pdf.PdfWriter)
methods and will be overwritten to false if a page-counter declaration is present in the CSS of the HTML being converted. Has no effect when used in conjunction withHtmlConverter.convertToPdf(java.lang.String, java.io.OutputStream)
orHtmlConverter.convertToElements(java.lang.String)
.- Returns:
- true if immediateFlush is set, false if not
-
setImmediateFlush
Set the immediate flush property of the layout document.This is used for
HtmlConverter.convertToDocument(java.lang.String, com.itextpdf.kernel.pdf.PdfWriter)
methods and will be overwritten to false if a page-counter declaration is present in the CSS of the HTML being converted. Has no effect when used in conjunction withHtmlConverter.convertToPdf(java.lang.String, java.io.OutputStream)
orHtmlConverter.convertToElements(java.lang.String)
.- Parameters:
-
immediateFlush
- the immediate flush value - Returns:
-
the
ConverterProperties
instance
-
setEventMetaInfo
public ConverterProperties setEventMetaInfo(com.itextpdf.commons.actions.contexts.IMetaInfo metaInfo) Sets html meta info.This meta info will be used to determine event origin.
- Parameters:
-
metaInfo
- meta info to set - Returns:
-
the
ConverterProperties
instance
-
isContinuousContainerEnabled
public boolean isContinuousContainerEnabled()check if continuous container is enabled.- Returns:
- true if enabled, false otherwise
-
setContinuousContainerEnabled
Sets continuous container support.- Parameters:
-
value
- true to set continuous container, false otherwise - Returns:
-
the
ConverterProperties
instance
-