public class Configuration extends Object
This class contains all options related to the PDF or image conversion.
Only Configuration.setDocument(String)
or Configuration.setDocument(byte[])
is required,
all other configuration settings are optional.
Modifier and Type | Class and Description |
---|---|
static class |
Configuration.AddressType
An enum containing IP address types.
|
static class |
Configuration.Attachment
A type containing attachment data.
|
static class |
Configuration.BookletMode
A type containing booklet mode data.
|
static class |
Configuration.Cleanup
An enum containing cleanup constants.
|
static class |
Configuration.ColorSpace
An enum containing color space constants.
|
static class |
Configuration.ColorSpaceSettings
A type containing settings for the potential conversion of
CSS colors and images into the target color space.
|
static class |
Configuration.Conformance
An enum containing conformance constants.
|
static class |
Configuration.ConnectionRule
A type containing security rule properties.
|
static class |
Configuration.ConnectionRuleAction
An enum containing security rule action constants.
|
static class |
Configuration.ContentObserver
A type containing specifications on which content should be observed.
|
static class |
Configuration.ContinuousOutput
A type containing continuous output data.
|
static class |
Configuration.CssPropertySupport
An enum containing CSS property support mode constants.
|
static class |
Configuration.CssSettings
A type containing settings of how CSS properties are supported.
|
static class |
Configuration.CustomUrlStreamHandler
A type containing a custom URLStreamHandler for a certain protocol.
|
static class |
Configuration.DebugSettings
A type containing various options for debugging.
|
static class |
Configuration.Doctype
An enum containing document type constants.
|
static class |
Configuration.Encryption
An enum containing encryption constants.
|
static class |
Configuration.ErrorPolicy
An enum containing error policies.
|
static class |
Configuration.ExceedingContentAgainst
An enum containing constants for logging exceeding content against.
|
static class |
Configuration.ExceedingContentAnalyze
An enum containing constants for analyzing exceeding content.
|
static class |
Configuration.Font
A type containing font data.
|
static class |
Configuration.HttpsMode
An enum containing HTTPS mode constants.
|
static class |
Configuration.JavaScriptDebugMode
An enum containing JavaScript debug mode constants.
|
static class |
Configuration.JavaScriptMode
Deprecated.
|
static class |
Configuration.JavaScriptSettings
A type containing settings related to JavaScript.
|
static class |
Configuration.KeystoreType
An enum containing keystore type constants.
|
static class |
Configuration.KeyValuePair
A type containing a key-value-pair.
|
static class |
Configuration.LogExceedingContent
A type containing data for logging exceeding content.
|
static class |
Configuration.LogLevel
An enum containing log level constants.
|
static class |
Configuration.MediaFeature
An enum containing media feature constants.
|
static class |
Configuration.MediaFeatureValue
A type containing media feature data.
|
static class |
Configuration.MergeMode
An enum containing merge mode constants.
|
static class |
Configuration.OutputFormat
A type containing output data.
|
static class |
Configuration.OutputIntent
A type containing data for an output intents.
|
static class |
Configuration.OutputIntentDefaultProfile
An enum containing default profiles for output intents.
|
static class |
Configuration.OutputType
An enum containing output format constants.
|
static class |
Configuration.OverlayRepeat
An enum containing data for repeating overlays.
|
static class |
Configuration.PageOrder
An enum containing pre-defined page orders.
|
static class |
Configuration.PagesPerSheetDirection
An enum containing constants for pages per sheet directions.
|
static class |
Configuration.PagesPerSheetProperties
A type containing data for pages per sheet properties.
|
static class |
Configuration.PdfScriptAction
A type containing PDF script data.
|
static class |
Configuration.PdfScriptTriggerEvent
An enum containing trigger events for PDF scripts.
|
static class |
Configuration.ProcessingPreferences
An enum containing constants for processing preferences.
|
static class |
Configuration.QuirksMode
An enum containing modes for Quirks.
|
static class |
Configuration.QuirksSettings
A type containing quirks settings.
|
static class |
Configuration.Resource
A type containing data for external resources such as style sheets.
|
static class |
Configuration.ScriptResource
Deprecated.
|
static class |
Configuration.SecurityDefaults
A type containing default behaviors for security settings.
|
static class |
Configuration.SecuritySettings
A type containing security settings.
|
static class |
Configuration.SegmentationSettings
A type containing settings for segmenting input documents.
|
static class |
Configuration.SigningMode
An enum containing the cryptographic filter type that is used for signing.
|
static class |
Configuration.SignPDF
A type containing data for signing the PDF.
|
static class |
Configuration.ViewerPreferences
An enum containing constants for viewer preferences.
|
static class |
Configuration.Xmp
A type containing XMP data.
|
static class |
Configuration.XmpPriority
An enum containing the priority for XMP.
|
Constructor and Description |
---|
Configuration() |
Modifier and Type | Method and Description |
---|---|
Configuration |
setAddAttachments(Boolean value)
Enables or disables attachments specified in style sheets.
|
Configuration |
setAddBookmarks(Boolean value)
Enables or disables bookmarks in the PDF document.
|
Configuration |
setAddComments(Boolean value)
Enables or disables comments in the PDF document.
|
Configuration |
setAddLinks(Boolean value)
Enables or disables links in the PDF document.
|
Configuration |
setAddOverprint(Boolean value)
Enables or disables overprinting.
|
Configuration |
setAddPreviewImages(Boolean value)
Enables or disables embedding of image previews per page in the PDF document.
|
Configuration |
setAddTags(Boolean value)
Enables or disables tagging of the PDF document.
|
Configuration |
setAllowAnnotations(Boolean value)
Enables or disables the 'annotations' restriction in the PDF document.
|
Configuration |
setAllowAssembly(Boolean value)
Enables or disables the 'assembly' restriction in the PDF document.
|
Configuration |
setAllowCopy(Boolean value)
Enables or disables the 'copy' restriction in the PDF document.
|
Configuration |
setAllowDegradedPrinting(Boolean value)
Enables or disables the 'degraded printing' restriction in the PDF document.
|
Configuration |
setAllowFillIn(Boolean value)
Enables or disables the 'fill in' restriction in the PDF document.
|
Configuration |
setAllowModifyContents(Boolean value)
Enables or disables the 'modify contents' restriction in the PDF document.
|
Configuration |
setAllowPrinting(Boolean value)
Enables or disables the 'printing' restriction in the PDF document.
|
Configuration |
setAllowScreenReaders(Boolean value)
Enables or disables the 'screen readers' restriction in the PDF document.
|
Configuration |
setAppendLog(Boolean value)
Specifies whether or not the log data should be added to the PDF document.
|
Configuration |
setAttachments(Configuration.Attachment[] values)
Adds a file attachment to PDF document.
|
Configuration |
setAuthenticationCredentials(Configuration.KeyValuePair value)
Enables access to resources that are secured via Basic or Digest authentication.
|
Configuration |
setAuthor(String value)
Sets the value of the author field of the PDF document.
|
Configuration |
setBaseURL(String value)
Sets the base URL of the document.
|
Configuration |
setBookletMode(Configuration.BookletMode value)
Convenience method to set pages-per-sheet properties and page order
in one step to create a booklet.
|
Configuration |
setCacheFonts(Boolean value)
Enables or disables caching of font information.
|
Configuration |
setCleanupTool(Configuration.Cleanup value)
Sets the cleanup tool to use for documents with unparsable content.
|
Configuration |
setColorSpaceSettings(Configuration.ColorSpaceSettings colorSpaceSettings)
Specifies color space related settings.
|
Configuration |
setConformance(Configuration.Conformance value)
Sets the conformance of the PDF.
|
Configuration |
setContentObserver(Configuration.ContentObserver value)
Specifies parts of the document's content that should be observed and logged in
greater detail.
|
Configuration |
setContinuousOutput(Configuration.ContinuousOutput value)
Enables the conversion of the input document into one image.
|
Configuration |
setConversionName(String value)
Sets a name for the conversion.
|
Configuration |
setCookies(Configuration.KeyValuePair[] values)
Adds a cookie to all outgoing HTTP connections.
|
Configuration |
setCreator(String value)
Sets the value of creator field of the PDF document.
|
Configuration |
setCssSettings(Configuration.CssSettings settings)
Specifies the behavior of PDFreactor regarding the support and validation
of CSS properties and their declaration.
|
Configuration |
setCustomDocumentProperties(Configuration.KeyValuePair[] values)
Adds a custom property to the PDF document.
|
Configuration |
setCustomUrlStreamHandlers(Configuration.CustomUrlStreamHandler[] values)
Adds a
URLStreamHandler for the specified protocol which will be used for all connections
to retrieve the input document and resources. |
Configuration |
setDebugSettings(Configuration.DebugSettings value)
Enables and configures debug settings, which add additional information to the output.
|
Configuration |
setDefaultColorSpace(Configuration.ColorSpace value)
Deprecated.
|
Configuration |
setDisableFontEmbedding(Boolean value)
Sets whether fonts will not be embedded into the resulting PDF.
|
Configuration |
setDisableFontRegistration(Boolean value)
Enables or disables the font registration.
|
Configuration |
setDisableSystemFonts(Boolean value)
Enables or disables the use of system fonts.
|
Configuration |
setDocument(byte[] value)
The input document as a byte array.
|
Configuration |
setDocument(InputSource value)
The document as
InputSource . |
Configuration |
setDocument(Object value)
Deprecated.
|
Configuration |
setDocument(String value)
The input document.
|
Configuration |
setDocumentDefaultLanguage(String value)
Sets the language used for documents having no explicit language attribute set.
|
Configuration |
setDocumentType(Configuration.Doctype value)
Sets the document type.
|
Configuration |
setEnableDebugMode(Boolean value)
Deprecated.
|
Configuration |
setEncoding(String value)
Sets the encoding of the document.
|
Configuration |
setEncryption(Configuration.Encryption value)
Sets the encryption.
|
Configuration |
setErrorPolicies(Configuration.ErrorPolicy[] values)
Specifies error policies that will be used for the conversion.
|
Configuration |
setFontAliases(Configuration.Font[] values)
Registers an alias font family for an existing font.
|
Configuration |
setFontCachePath(String value)
Sets the path of the font cache.
|
Configuration |
setFontDirectories(String[] values)
Registers an additional font directory to load fonts from.
|
Configuration |
setFontFallback(String[] values)
Sets a list of fallback font families used for character substitution.
|
Configuration |
setFonts(Configuration.Font[] values)
Loads a font from a URL which can be used via the CSS property
font-family . |
Configuration |
setForceGrayscaleImage(Boolean value)
If the output format is an image format, this setting controls whether a
grayscale image should be returned.
|
Configuration |
setFullCompression(Boolean value)
Enables or disables full compression of the PDF document.
|
Configuration |
setHttpsMode(Configuration.HttpsMode value)
Sets the HTTPS mode.
|
Configuration |
setIgnoreAlpha(Boolean value)
Sets whether the alpha value of CSS RGBA colors is ignored.
|
Configuration |
setIntegrationStyleSheets(Configuration.Resource[] values)
Adds an integration style sheet to the document.
|
Configuration |
setJavaScriptMode(Configuration.JavaScriptMode value)
Deprecated.
|
Configuration |
setJavaScriptSettings(Configuration.JavaScriptSettings value)
Specifies JavaScript related settings.
|
Configuration |
setKeywords(String value)
Sets the value of the keywords field of the PDF document.
|
Configuration |
setLicenseKey(String value)
Sets the license key using a string.
|
Configuration |
setLogExceedingContent(Configuration.LogExceedingContent value)
Deprecated.
|
Configuration |
setLogger(Logger value)
Sets a
Logger to receive log messages. |
Configuration |
setLogLevel(Configuration.LogLevel value)
Sets the log level.
|
Configuration |
setMediaFeatureValues(Configuration.MediaFeatureValue[] values)
Defines the value of a Media Feature which is used to resolve CSS3 media queries.
|
Configuration |
setMediaTypes(String[] values)
Sets the media types that are used to resolve CSS3 media queries.
|
Configuration |
setMergeByteArray(byte[] value)
Deprecated.
|
Configuration |
setMergeByteArrays(byte[][] values)
Deprecated.
|
Configuration |
setMergeDocuments(Configuration.Resource[] documents)
This method sets external PDF documents which will be
merged with the PDF document generated by the HTML source.
|
Configuration |
setMergeMode(Configuration.MergeMode value)
Sets the merge mode.
|
Configuration |
setMergeURL(String value)
Deprecated.
|
Configuration |
setMergeURLs(String[] values)
Deprecated.
|
Configuration |
setOutputFormat(Configuration.OutputFormat value)
Sets the
Configuration.OutputFormat . |
Configuration |
setOutputIntent(Configuration.OutputIntent value)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
|
Configuration |
setOverlayRepeat(Configuration.OverlayRepeat value)
If one of the documents of an overlay process is shorter than the other, this method
allows repeating either its last page or all of its pages in order to overlay all pages of
the longer document.
|
Configuration |
setOwnerPassword(String value)
Sets the owner password of the PDF document.
|
Configuration |
setPageOrder(Configuration.PageOrder value)
Sets the page order of the direct result of the conversion.
|
Configuration |
setPageOrder(String value)
Sets the page order of the direct result of the conversion.
|
Configuration |
setPagesPerSheetProperties(Configuration.PagesPerSheetProperties value)
Sets the properties of a sheet on which multiple pages are being arranged.
|
Configuration |
setPdfScriptAction(Configuration.PdfScriptAction[] values)
Sets a pair of trigger event and PDF script.
|
Configuration |
setPixelsPerInch(Integer value)
Sets the pixels per inch.
|
Configuration |
setPixelsPerInchShrinkToFit(Boolean value)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
|
Configuration |
setPostTransformationDocumentType(Configuration.Doctype value)
Sets the document type after the XSL-Transformations have been applied.
|
Configuration |
setPrintDialogPrompt(Boolean value)
Enables or disables a print dialog to be shown upon opening
the generated PDF document by a PDF viewer.
|
Configuration |
setProcessingPreferences(Configuration.ProcessingPreferences[] values)
Preferences that influence the conversion process without changing
the output.
|
Configuration |
setProgressEventListeners(ProgressEventListener[] values)
Adds a
ProgressEventListener . |
Configuration |
setQuirksSettings(Configuration.QuirksSettings quirksSettings)
Allows to enable or disable behaviors
that are otherwise depend on the doctype of the input document.
|
Configuration |
setRawCookies(Configuration.KeyValuePair[] values)
Adds a cookie to all outgoing HTTP connections.
|
Configuration |
setRequestHeaders(Configuration.KeyValuePair[] values)
Adds a request header to all outgoing HTTP connections.
|
Configuration |
setResourceConnectTimeout(Integer value)
Sets a timeout in milliseconds for connecting to resources, such as HTTP requests to
style sheets, images etc.
|
Configuration |
setResourceReadTimeout(Integer value)
Sets a timeout in milliseconds for reading resources, such as HTTP requests to
style sheets, images etc.
|
Configuration |
setResourceRequestTimeout(Integer value)
Deprecated.
|
Configuration |
setSecuritySettings(Configuration.SecuritySettings securitySettings)
Specifies resource loading and document processing behavior with regards to
security to protect against untrusted code or content.
|
Configuration |
setSegmentationSettings(Configuration.SegmentationSettings segmentationSettings)
This property configures segmentation of the conversion,
which helps with very large documents.
|
Configuration |
setSignPDF(Configuration.SignPDF value)
Sets a digital certificate to sign the newly created PDF.
|
Configuration |
setSubject(String value)
Sets the value of the subject field of the PDF document.
|
Configuration |
setThrowLicenseExceptions(Boolean value)
Deprecated.
|
Configuration |
setTitle(String value)
Sets the value of the title field of the PDF document.
|
Configuration |
setUserPassword(String value)
Sets the user password of the PDF document.
|
Configuration |
setUserScripts(Configuration.Resource[] values)
Adds an user script to the document.
|
Configuration |
setUserStyleSheets(Configuration.Resource[] values)
Adds a user style sheet to the document.
|
Configuration |
setValidateConformance(Boolean value)
Enables PDFreactor to validate the generated PDF against the
Configuration.Conformance specified via Configuration.setConformance(Conformance) . |
Configuration |
setViewerPreferences(Configuration.ViewerPreferences[] values)
Sets the page layout and page mode preferences of the PDF.
|
Configuration |
setXmp(Configuration.Xmp value)
Sets custom XMP to be embedded into the PDF document.
|
Configuration |
setXsltMode(Boolean value)
Enables or disables XSLT transformations.
|
Configuration |
setXsltStyleSheets(Configuration.Resource[] values)
Adds an XSLT style sheet to the document.
|
public Configuration setAddAttachments(Boolean value)
Enables or disables attachments specified in style sheets.
The default value is false
.
Configuration
instance.public Configuration setAddBookmarks(Boolean value)
Enables or disables bookmarks in the PDF document.
The default value isfalse
.Configuration
instance.public Configuration setAddComments(Boolean value)
Enables or disables comments in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAddLinks(Boolean value)
Enables or disables links in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAddOverprint(Boolean value)
Enables or disables overprinting.
The default value is false
.
Configuration
instance.public Configuration setAddPreviewImages(Boolean value)
Enables or disables embedding of image previews per page in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAddTags(Boolean value)
Enables or disables tagging of the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowAnnotations(Boolean value)
Enables or disables the 'annotations' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowAssembly(Boolean value)
Enables or disables the 'assembly' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowCopy(Boolean value)
Enables or disables the 'copy' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowDegradedPrinting(Boolean value)
Enables or disables the 'degraded printing' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowFillIn(Boolean value)
Enables or disables the 'fill in' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowModifyContents(Boolean value)
Enables or disables the 'modify contents' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowPrinting(Boolean value)
Enables or disables the 'printing' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAllowScreenReaders(Boolean value)
Enables or disables the 'screen readers' restriction in the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAppendLog(Boolean value)
Specifies whether or not the log data should be added to the PDF document.
The default value is false
.
Configuration
instance.public Configuration setAttachments(Configuration.Attachment[] values)
Adds a file attachment to PDF document.
Configuration
instance.public Configuration setAuthenticationCredentials(Configuration.KeyValuePair value)
Enables access to resources that are secured via Basic or Digest authentication.
Configuration
instance.public Configuration setAuthor(String value)
Sets the value of the author field of the PDF document.
Configuration
instance.public Configuration setBaseURL(String value)
Sets the base URL of the document.
To resolve relative URLs to absolute URLs a reference (base) URL is required. This reference URL is usually the system id of the document.
This method can be used to specify another reference URL. If this URL is not
null
then it will be used instead of the system id.
The default value is null
.
Configuration
instance.public Configuration setBookletMode(Configuration.BookletMode value)
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
Configuration
instance.public Configuration setCacheFonts(Boolean value)
Enables or disables caching of font information.
During the PDF creation PDFreactor
requires information about
fonts in the system. The process to get this information takes a
long time, thus PDFreactor offers an option to cache the collected
information about fonts.
A font cache can be reused by PDFreactor
on every PDF creation
process but only if font registration is enabled. If font registration
is disabled then the font cache will be ignored. (see Configuration.setDisableFontRegistration(Boolean)
for more information).
The default value is true
.
Configuration
instance.Configuration.setDisableFontRegistration(Boolean)
public Configuration setCleanupTool(Configuration.Cleanup value)
Sets the cleanup tool to use for documents with unparsable content.
The Configuration.Cleanup
constants can be used as value. The
default value specified is Configuration.Cleanup.CYBERNEKO
.
The cleanup tool is only used for Configuration.setDocumentType(Doctype)
Configuration.Doctype.XHTML
.
HTML5 utilizes an internal cleanup.
Configuration
instance.Configuration.Cleanup.CYBERNEKO
,
Configuration.Doctype.XHTML
public Configuration setConformance(Configuration.Conformance value)
Sets the conformance of the PDF.
The Configuration.Conformance
constants can be used as value. The default
value specified is Configuration.Conformance.PDF
.
Configuration
instance.Configuration.Conformance.PDF
public Configuration setContentObserver(Configuration.ContentObserver value)
Specifies parts of the document's content that should be observed and logged in greater detail. Data logged this way can be programmatically retrieved after the conversion has finished. The following can be observed:
Content exceeding boundary containers.
Use Configuration.ExceedingContentAnalyze
constants to specify
which kind of content should be observed for exceeding content logging.
The default value is Configuration.ExceedingContentAnalyze.NONE
.
Use Configuration.ExceedingContentAgainst
constants to specify
that exceeding this content starts exceeding content logging.
The default value is Configuration.ExceedingContentAgainst.NONE
.
Configuration
instance.Configuration.ExceedingContentAnalyze.NONE
,
Configuration.ExceedingContentAgainst.NONE
public Configuration setContinuousOutput(Configuration.ContinuousOutput value)
Enables the conversion of the input document into one image.
Configuration
instance.public Configuration setConversionName(String value)
Sets a name for the conversion. If a name is set, it will be logged at level "info". The name can be an arbitrary string but should be unique for every conversion or application so that the log output can be matched to a specific conversion or application later.
Configuration
instance.public Configuration setCookies(Configuration.KeyValuePair[] values)
Adds a cookie to all outgoing HTTP connections. The parameters are URL encoded (see
Configuration.getRawCookies()
). If the key already exists, the pair is overwritten.
Configuration
instance.Configuration.getRawCookies()
public Configuration setCssSettings(Configuration.CssSettings settings)
Specifies the behavior of PDFreactor regarding the support and validation of CSS properties and their declaration. The following modes can be set:
Configuration.CssPropertySupport.ALL
Configuration.CssPropertySupport.HTML
Configuration.CssPropertySupport.HTML_THIRD_PARTY
Configuration.CssPropertySupport.HTML_THIRD_PARTY_LENIENT
settings
- Configuration
instance.Configuration.CssPropertySupport.ALL
,
Configuration.CssPropertySupport.HTML
,
Configuration.CssPropertySupport.HTML_THIRD_PARTY
,
Configuration.CssPropertySupport.HTML_THIRD_PARTY_LENIENT
public Configuration setColorSpaceSettings(Configuration.ColorSpaceSettings colorSpaceSettings)
Specifies color space related settings.
Configuration
instance.public Configuration setCreator(String value)
Sets the value of creator field of the PDF document.
Configuration
instance.public Configuration setCustomDocumentProperties(Configuration.KeyValuePair[] values)
Adds a custom property to the PDF document. An existing property of the same name will be replaced.
Configuration
instance.public Configuration setCustomUrlStreamHandlers(Configuration.CustomUrlStreamHandler[] values)
Adds a URLStreamHandler
for the specified protocol which will be used for all connections
to retrieve the input document and resources.
Configuration
instance.@Deprecated public Configuration setDefaultColorSpace(Configuration.ColorSpace value)
Deprecated as of PDFreactor 10. Use Configuration.setColorSpaceSettings(ColorSpaceSettings)
and Configuration.ColorSpaceSettings.setTargetColorSpace(Configuration.ColorSpace)
instead.
public Configuration setDisableFontEmbedding(Boolean value)
Sets whether fonts will not be embedded into the resulting PDF. Setting this to true will reduce the file size of the output document. However, the resulting PDF documents are no longer guaranteed to look identical on all systems.
The default value is false
.
Configuration
instance.public Configuration setDisableFontRegistration(Boolean value)
Enables or disables the font registration. If font registration is enabled and a valid font cache exists then this font cache will be used. If font registration is disabled, any existing font cache will be ignored and the font directories will be scanned for font information.
The default value is false
.
Configuration
instance.public Configuration setDisableSystemFonts(Boolean value)
Enables or disables the use of system fonts. If system fonts are disabled, PDFreactor will neither scan for system fonts nor use the respective font cache.
The default value is false
.
Configuration
instance.@Deprecated public Configuration setDocument(Object value)
Deprecated as of PDFreactor 9. Use Configuration.setDocument(byte[])
, Configuration.setDocument(org.xml.sax.InputSource)
or Configuration.setDocument(String)
instead.
Configuration
instance.Configuration.setDocument(String)
,
Configuration.setDocument(byte[])
,
Configuration.setDocument(org.xml.sax.InputSource)
public Configuration setDocument(String value)
The input document. This can either be a URL string, XML or HTML source code string.
Configuration
instance.public Configuration setDocument(byte[] value)
The input document as a byte array.
Configuration
instance.public Configuration setDocument(InputSource value)
The document as InputSource
.
inputSource
- The input source.Configuration
instance.public Configuration setDocumentDefaultLanguage(String value)
Sets the language used for documents having no explicit language attribute set.
The language code is used to resolve the lang() selector correct and to determine the correct language used for hyphenation.
Configuration
instance.public Configuration setDocumentType(Configuration.Doctype value)
Sets the document type.
The Configuration.Doctype
constants can be used to specify the
document type. The default value specified is
Configuration.Doctype.AUTODETECT
.
Configuration
instance.Configuration.Doctype.AUTODETECT
@Deprecated public Configuration setEnableDebugMode(Boolean value)
Deprecated as of PDFreactor 10. Use
Configuration.setDebugSettings(DebugSettings)
instead.
Configuration
instance.#setDebugSettings(DebugSettings)}
public Configuration setDebugSettings(Configuration.DebugSettings value)
Enables and configures debug settings, which add additional information to the output.
If enabled, exceptions during the conversion will not be thrown. In such a case, instead of a document a string containing the log and exception will be returned.
Configuration
instance.public Configuration setEncoding(String value)
Sets the encoding of the document.
If this value is set to null
or it is empty then the
encoding will be detected automatically.
The default value is null
.
Configuration
instance.public Configuration setEncryption(Configuration.Encryption value)
Sets the encryption.
Use one of the Configuration.Encryption
constants to specify the
encryption. The default value is Configuration.Encryption.NONE
.
Configuration
instance.Configuration.Encryption.NONE
public Configuration setErrorPolicies(Configuration.ErrorPolicy[] values)
Specifies error policies that will be used for the conversion. Depending on the policy, the conversion will fail if the appropriate criteria are not met.
Configuration
instance.public Configuration setFontAliases(Configuration.Font[] values)
Registers an alias font family for an existing font.
This function is limited to fonts loaded automatically from system folders.
Configuration
instance.public Configuration setFontCachePath(String value)
Sets the path of the font cache. This path will be used to read
and write the font cache. If the font cache path is set to
null
then the "user.home" directory will be used.
The default value is null
.
Configuration
instance.public Configuration setFontDirectories(String[] values)
Registers an additional font directory to load fonts from.
Fonts from subdirectories are also loaded.
Configuration
instance.public Configuration setFontFallback(String[] values)
Sets a list of fallback font families used for character substitution. This
list is iterated for characters that can not be displayed with any of the fonts
specified via the CSS property font-family
.
Configuration
instance.public Configuration setFonts(Configuration.Font[] values)
Loads a font from a URL which can be used via the CSS property font-family
.
Configuration
instance.public Configuration setForceGrayscaleImage(Boolean value)
If the output format is an image format, this setting controls whether a grayscale image should be returned. This can not be combined with transparency.
Configuration
instance.public Configuration setFullCompression(Boolean value)
Enables or disables full compression of the PDF document.
The default value is false
.
Configuration
instance.public Configuration setHttpsMode(Configuration.HttpsMode value)
Sets the HTTPS mode. In closed environment lenient can be the preferred setting to avoid HTTPS issues that are not security critical
The default value specified is Configuration.HttpsMode.STRICT
.
Configuration
instance.Configuration.HttpsMode.STRICT
public Configuration setIgnoreAlpha(Boolean value)
Sets whether the alpha value of CSS RGBA colors is ignored. This can be used to avoid conformance issues in PDF/A-1.
Configuration
instance.public Configuration setIntegrationStyleSheets(Configuration.Resource[] values)
Adds an integration style sheet to the document.
There are two ways to specify the style sheet:
Configuration
instance.@Deprecated public Configuration setJavaScriptMode(Configuration.JavaScriptMode value)
Deprecated as of PDFreactor 10. Use Configuration.setJavaScriptSettings(JavaScriptSettings)
instead.
Configuration
instance.Configuration.setJavaScriptSettings(JavaScriptSettings)
public Configuration setJavaScriptSettings(Configuration.JavaScriptSettings value)
Specifies JavaScript related settings.
Configuration
instance.public Configuration setKeywords(String value)
Sets the value of the keywords field of the PDF document.
Configuration
instance.public Configuration setLicenseKey(String value)
Sets the license key using a string. If the license key is set
to null
then PDFreactor looks for a 'licensekey.xml'
file in the same directory where the 'PDFreactor.jar' file is located.
If no license key could be found then PDFreactor runs in evaluation mode.
The default value is null
.
Configuration
instance.@Deprecated public Configuration setLogExceedingContent(Configuration.LogExceedingContent value)
Deprecated as of PDFreactor 9. Use
Configuration.setContentObserver(ContentObserver)
instead.
Configuration
instance.Configuration.setContentObserver(ContentObserver)
public Configuration setLogger(Logger value)
Sets a Logger
to receive log messages.
The default value is null
.
Configuration
instance.public Configuration setLogLevel(Configuration.LogLevel value)
Sets the log level.
Use one of the Configuration.LogLevel
constants to specify the log level.
The default value is Configuration.LogLevel.NONE
.
Configuration
instance.Configuration.LogLevel.NONE
public Configuration setMediaFeatureValues(Configuration.MediaFeatureValue[] values)
Defines the value of a Media Feature which is used to resolve CSS3 media queries.
Configuration
instance.public Configuration setMediaTypes(String[] values)
Sets the media types that are used to resolve CSS3 media queries.
Please note that this overrides the default media types of PDFreactor, which are:
"print"
, "paged"
, "visual"
, "bitmap"
, "static"
, "-ro-pdfreactor"
Configuration
instance.@Deprecated public Configuration setMergeByteArray(byte[] value)
Deprecated as of PDFreactor 9. Use Configuration.setMergeDocuments(Resource...)
instead.
Configuration
instance.Configuration.setMergeDocuments(Resource...)
@Deprecated public Configuration setMergeByteArrays(byte[][] values)
Deprecated as of PDFreactor 9. Use Configuration.setMergeDocuments(Resource...)
instead.
Configuration
instance.Configuration.setMergeDocuments(Resource...)
@Deprecated public Configuration setMergeURL(String value)
Deprecated as of PDFreactor 9. Use Configuration.setMergeDocuments(Resource...)
instead.
Configuration
instance.Configuration.setMergeDocuments(Resource...)
@Deprecated public Configuration setMergeURLs(String[] values)
Deprecated as of PDFreactor 9. Use Configuration.setMergeDocuments(Resource...)
instead.
Configuration
instance.Configuration.setMergeDocuments(Resource...)
public Configuration setMergeDocuments(Configuration.Resource[] documents)
This method sets external PDF documents which will be merged with the PDF document generated by the HTML source.
documents
- The documents.Configuration
instance.public Configuration setMergeMode(Configuration.MergeMode value)
Sets the merge mode.
The following merge methods can be used:
Configuration.MergeMode.APPEND
)Configuration.MergeMode.PREPEND
)Configuration.MergeMode.OVERLAY
)Configuration.MergeMode.OVERLAY_BELOW
)The default value is Configuration.MergeMode.APPEND
.
Configuration
instance.Configuration.MergeMode.APPEND
,
Configuration.MergeMode.PREPEND
,
Configuration.MergeMode.OVERLAY
,
Configuration.MergeMode.OVERLAY_BELOW
,
Configuration.MergeMode.APPEND
public Configuration setOutputFormat(Configuration.OutputFormat value)
Sets the Configuration.OutputFormat
. The default value is OutputFormat#PDF
.
For image formats the width or height in pixels must be specified.
When either dimension is <1 it is computed based on the other dimension and the aspect ratio of the input document.
Configuration
instance.public Configuration setOutputIntent(Configuration.OutputIntent value)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
Set either the profile URL or the profile data, not both. Certain PDF/X formats require neither, just a known identifier.
Configuration
instance.public Configuration setOverlayRepeat(Configuration.OverlayRepeat value)
If one of the documents of an overlay process is shorter than the other, this method allows repeating either its last page or all of its pages in order to overlay all pages of the longer document.
Use one of the Configuration.OverlayRepeat
constants to specify the
overlay repeat. The default value is Configuration.OverlayRepeat.NONE
.
Configuration
instance.Configuration.OverlayRepeat.NONE
public Configuration setOwnerPassword(String value)
Sets the owner password of the PDF document.
The default value is null
.
Configuration
instance.public Configuration setPageOrder(String value)
Sets the page order of the direct result of the conversion.
If Configuration.setMergeMode(MergeMode)
is set to Configuration.MergeMode.ARRANGE
,
this method is also used to specify the position of inserted pages from
an existing PDF.
A description of the syntax can be found in the manual.
Configuration
instance.Configuration.setMergeMode(MergeMode)
,
Configuration.MergeMode.ARRANGE
public Configuration setPageOrder(Configuration.PageOrder value)
Sets the page order of the direct result of the conversion.
If Configuration.setMergeMode(MergeMode)
is set to Configuration.MergeMode.ARRANGE
,
this method is also used to specify the position of inserted pages from
an existing PDF.
A description of the syntax can be found in the manual.
Configuration
instance.Configuration.setMergeMode(MergeMode)
,
Configuration.MergeMode.ARRANGE
public Configuration setPagesPerSheetProperties(Configuration.PagesPerSheetProperties value)
Sets the properties of a sheet on which multiple pages are being arranged.
If Configuration.PagesPerSheetProperties.setCols(Integer)
or Configuration.PagesPerSheetProperties.setRows(Integer)
is less than 1, no
pages-per-sheet processing is done. This is the case by default.
Use one of the Configuration.PagesPerSheetDirection
constants to
specify the the direction. The default value is Configuration.PagesPerSheetDirection.RIGHT_DOWN
.
Configuration
instance.Configuration.PagesPerSheetDirection.RIGHT_DOWN
public Configuration setPdfScriptAction(Configuration.PdfScriptAction[] values)
Sets a pair of trigger event and PDF script. The script is triggered on the specified event.
A PDF script is JavaScript that is executed by a PDF viewer (e.g. Adobe Reader). Note that most viewers do not support this feature.
PDF Scripts can also be set by using the proprietary CSS property
pdf-script-action
. More information on this property can be found
in the manual.
Please note, that scripts set via CSS have a higher priority. If two scripts are registered on the same event, but one via API and the other via the CSS property, the script set in the CSS will override the other one.
Configuration
instance.public Configuration setPixelsPerInch(Integer value)
Sets the pixels per inch.
Changing this value changes the physical length of sizes specified in px (including those specified via HTML attributes).
The default value is 96
ppi.
Configuration
instance.public Configuration setPixelsPerInchShrinkToFit(Boolean value)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
Configuration
instance.public Configuration setPostTransformationDocumentType(Configuration.Doctype value)
Sets the document type after the XSL-Transformations have been applied.
The Configuration.Doctype
constants can be used to specify the
document type. The default value specified is Configuration.Doctype.AUTODETECT
.
Configuration
instance.Configuration.Doctype.AUTODETECT
public Configuration setPrintDialogPrompt(Boolean value)
Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.
The default value is false
.
Configuration
instance.public Configuration setProcessingPreferences(Configuration.ProcessingPreferences[] values)
Preferences that influence the conversion process without changing the output.
Use the Configuration.ProcessingPreferences
constants to specify the
processing preferences. By default no processing preference is set.
Configuration
instance.public Configuration setProgressEventListeners(ProgressEventListener[] values)
Adds a ProgressEventListener
.
Configuration
instance.public Configuration setRawCookies(Configuration.KeyValuePair[] values)
Adds a cookie to all outgoing HTTP connections.
The parameters are not URL encoded (see Configuration.getCookies()
).
If the key already exists, the pair is overwritten.
Configuration
instance.Configuration.getCookies()
public Configuration setRequestHeaders(Configuration.KeyValuePair[] values)
Adds a request header to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
Configuration
instance.@Deprecated public Configuration setResourceRequestTimeout(Integer value)
Deprecated as of PDFreactor 10. Use Configuration.setResourceConnectTimeout(Integer)
and Configuration.setResourceReadTimeout(Integer)
instead.
Configuration
instance.Configuration.setResourceConnectTimeout(Integer)
,
Configuration.setResourceReadTimeout(Integer)
public Configuration setResourceConnectTimeout(Integer value)
Sets a timeout in milliseconds for connecting to resources, such as HTTP requests to style sheets, images etc. If the connection could not be established until the timeout expires, the request will be aborted and the resource will not be loaded.
A timeout of 0 means that the connection will not time out. A negative value means that no timeout will be set. The default value is 60000 (1min).
Configuration
instance.public Configuration setResourceReadTimeout(Integer value)
Sets a timeout in milliseconds for reading resources, such as HTTP requests to style sheets, images etc. If the download does not start until the timeout expires, the request will be aborted and the resource will not be loaded.
A timeout of 0 means that the download will not time out. A negative value means that no timeout will be set. The default value is 60000 (1min).
Configuration
instance.public Configuration setSignPDF(Configuration.SignPDF value)
Sets a digital certificate to sign the newly created PDF.
Requires a keystore file. The included certificate may be self-signed.
Use the Configuration.KeystoreType
constants to specify the keystore type.
Use the Configuration.SigningMode
constants to specify the cryptographic filter that is used for signing.
Configuration
instance.public Configuration setSubject(String value)
Sets the value of the subject field of the PDF document.
Configuration
instance.@Deprecated public Configuration setThrowLicenseExceptions(Boolean value)
Deprecated as of PDFreactor 9. Use Configuration.setErrorPolicies(ErrorPolicy...)
instead.
Configuration
instance.Configuration.setErrorPolicies(ErrorPolicy...)
public Configuration setTitle(String value)
Sets the value of the title field of the PDF document.
Configuration
instance.public Configuration setUserPassword(String value)
Sets the user password of the PDF document.
The default value is null
.
Configuration
instance.public Configuration setUserScripts(Configuration.Resource[] values)
Adds an user script to the document.
There are two ways to specify the script:
Configuration
instance.public Configuration setUserStyleSheets(Configuration.Resource[] values)
Adds a user style sheet to the document.
There are two ways to specify the style sheet:
Configuration
instance.public Configuration setViewerPreferences(Configuration.ViewerPreferences[] values)
Sets the page layout and page mode preferences of the PDF.
Use the Configuration.ViewerPreferences
constants to specify the
viewer preferences. By default no viewer preference is set.
Configuration
instance.public Configuration setXmp(Configuration.Xmp value)
Sets custom XMP to be embedded into the PDF document.
If both Configuration.Xmp.setContent(String)
and Configuration.Xmp.setUri(String)
are not set or
null
no custom XMP is embedded.
If Configuration.XmpPriority
is also set to Configuration.XmpPriority.HIGH
automatic generation of required XMP is also suppressed.
This may cause output PDFs to not archive a specified conformance.
Configuration
instance.Configuration.XmpPriority.HIGH
public Configuration setXsltMode(Boolean value)
Enables or disables XSLT transformations.
Set this value to true
to enable XSLT transformations or
to false
to disable XSLT transformations.
The default value is false
.
Configuration
instance.public Configuration setXsltStyleSheets(Configuration.Resource[] values)
Adds an XSLT style sheet to the document.
There are two ways to specify the style sheet:
Configuration
instance.public Configuration setValidateConformance(Boolean value)
Enables PDFreactor to validate the generated PDF against the
Configuration.Conformance
specified via Configuration.setConformance(Conformance)
.
Currently only PDF/A validation is supported.
Please note that validation might take several minutes for larger documents.
Configuration
instance.public Configuration setQuirksSettings(Configuration.QuirksSettings quirksSettings)
Allows to enable or disable behaviors that are otherwise depend on the doctype of the input document.
Configuration
instance.public Configuration setSecuritySettings(Configuration.SecuritySettings securitySettings)
Specifies resource loading and document processing behavior with regards to security to protect against untrusted code or content.
Configuration
instance.public Configuration setSegmentationSettings(Configuration.SegmentationSettings segmentationSettings)
This property configures segmentation of the conversion, which helps with very large documents.
This doc was generated on 2020-09-17. Copyright © 2002-2020 RealObjects GmbH. All Rights Reserved.