Class Configuration
This class contains all options related to the PDF or image conversion.
Only setDocument(String)
or setDocument(byte[])
is required,
all other configuration settings are optional.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enum containing IP address types.static final class
A type containing attachment data.static final class
A type containing booklet mode data.static enum
An enum containing cleanup constants.static enum
An enum containing color space constants.static final class
A type containing settings for the potential conversion of CSS colors and images into the target color space.static enum
An enum containing conformance constants.static final class
A type containing security rule properties.static enum
An enum containing security rule action constants.static final class
A type containing specifications on which content should be observed.static final class
A type containing continuous output data.static final class
An object containing cookie data.static enum
An enum containing cookie policy constants.static enum
An enum containing CSS property support mode constants.static final class
A type containing settings of how CSS properties are supported.static final class
A type containing a custom URLStreamHandler for a certain protocol.static final class
A type containing various options for debugging.static enum
An enum containing document type constants.static enum
An enum containing encryption constants.static final class
A type containing settings related to PDF encryption.static enum
An enum containing error policies.static enum
An enum containing constants for logging exceeding content against.static enum
An enum containing constants for analyzing exceeding content.static final class
A type containing font data.static enum
An enum containing HTTP authentication scheme constants.static final class
An object containing HTTP authentication credentials data.static enum
An enum containing HTTP protocol constants.static enum
Deprecated.static final class
A type containing settings related to inspectable documents.static enum
An enum containing JavaScript debug mode constants.static enum
An enum containing JavaScript engines.static final class
A type containing settings related to JavaScript.static enum
An enum containing keystore type constants.static final class
A type containing a key-value-pair.static final class
A type containing data for logging exceeding content.static enum
An enum containing log level constants.static enum
An enum containing media feature constants.static final class
A type containing media feature data.static enum
An enum containing merge mode constants.static final class
A type containing settings related to PDF merging.static final class
An object containing network settings data.static final class
A type containing output data.static final class
A type containing data for an output intents.static enum
An enum containing default profiles for output intents.static enum
An enum containing output format constants.static enum
An enum containing constants that determines whether the converted document or the specified PDF document(s) is the content document for overlaying.static enum
An enum containing data to configure how overlay pages that have different dimensions from the pages they are overlaying should be resized.static enum
An enum containing data for repeating overlays.static enum
An enum containing pre-defined page orders.static enum
An enum containing constants for pages per sheet directions.static final class
A type containing data for pages per sheet properties.static final class
A type containing PDF script data.static enum
An enum containing trigger events for PDF scripts.static enum
An enum containing constants for processing preferences.static enum
An enum containing modes for Quirks.static final class
A type containing quirks settings.static enum
An enum containing resolution units.static final class
A type containing data for external resources such as style sheets.static enum
An enum containing resource sub type constants.static final class
A type containing default behaviors for security settings.static final class
A type containing security settings.static final class
A type containing settings for segmenting input documents.static enum
An enum containing the cryptographic filter type that is used for signing.static final class
A type containing data for signing the PDF.static final class
A type containing various options for debugging.static final class
A type containing various options for URL rewrites.static enum
An enum containing constants for viewer preferences.static final class
A type containing XMP data.static enum
An enum containing the priority for XMP. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Configuration
setAddAttachments
(Boolean value) Enables or disables attachments specified in style sheets.final Configuration
setAddBookmarks
(Boolean value) Deprecated.final Configuration
setAddComments
(Boolean value) Enables or disables comments in the PDF document.final Configuration
setAddLinks
(Boolean value) Deprecated.final Configuration
setAddOverprint
(Boolean value) Enables or disables overprinting.final Configuration
setAddPreviewImages
(Boolean value) Enables or disables embedding of image previews per page in the PDF document.final Configuration
setAddTags
(Boolean value) Enables or disables tagging of the PDF document.final Configuration
setAllowAnnotations
(Boolean value) Deprecated.final Configuration
setAllowAssembly
(Boolean value) Deprecated.final Configuration
setAllowCopy
(Boolean value) Deprecated.final Configuration
setAllowDegradedPrinting
(Boolean value) Deprecated.final Configuration
setAllowFillIn
(Boolean value) Deprecated.final Configuration
setAllowModifyContents
(Boolean value) Deprecated.final Configuration
setAllowPrinting
(Boolean value) Deprecated.final Configuration
setAllowScreenReaders
(Boolean value) Deprecated.final Configuration
setAppendLog
(Boolean value) Specifies whether or not the log data should be added to the PDF document.final Configuration
setAttachments
(Configuration.Attachment... values) Adds a file attachment to PDF document.final Configuration
Deprecated.final Configuration
Sets the value of the author field of the PDF document.final Configuration
setBaseUrl
(String value) Sets the base URL of the document.final Configuration
setBaseURL
(String value) Deprecated.final Configuration
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.final Configuration
setCacheFonts
(Boolean value) Enables or disables caching of font information.final Configuration
Sets the cleanup tool to use for documents with unparsable content.final Configuration
setColorSpaceSettings
(Configuration.ColorSpaceSettings colorSpaceSettings) Specifies color space related settings.final Configuration
Sets the conformance of the PDF.final Configuration
Specifies parts of the document's content that should be observed and logged in greater detail.final Configuration
Enables the conversion of the input document into one image.final Configuration
setConversionName
(String value) Sets a name for the conversion.final Configuration
setConversionTimeout
(Integer value) Sets a timeout in seconds for the whole document conversion.final Configuration
setCookies
(Configuration.KeyValuePair... values) Deprecated.final Configuration
setCreator
(String value) Sets the value of creator field of the PDF document.final Configuration
setCssSettings
(Configuration.CssSettings settings) Specifies the behavior of PDFreactor regarding the support and validation of CSS properties and their declaration.final Configuration
Adds a custom property to the PDF document.final Configuration
Adds aURLStreamHandler
for the specified protocol which will be used for all connections to retrieve the input document and resources.final Configuration
Enables and configures debug settings, which add additional information to the output.final Configuration
setDisableBookmarks
(Boolean value) Disables bookmarks in the PDF document.final Configuration
setDisableFontEmbedding
(Boolean value) Sets whether fonts will not be embedded into the resulting PDF.final Configuration
Enables or disables the font registration.final Configuration
setDisableLinks
(Boolean value) Disables links in the PDF document.final Configuration
Disables the automatic optimization and compression of the PDF structure.final Configuration
setDisableSystemFonts
(Boolean value) Enables or disables the use of system fonts.final Configuration
setDocument
(byte[] value) The input document as a byte array.final Configuration
setDocument
(String value) The input document.final Configuration
setDocument
(InputSource value) The document asInputSource
.final Configuration
setDocumentDefaultLanguage
(String value) Sets the language used for documents having no explicit language attribute set.final Configuration
Sets the document type.final Configuration
setEncoding
(String value) Sets the encoding of the document.final Configuration
Deprecated.final Configuration
setEncryptionSettings
(Configuration.EncryptionSettings encryptionSettings) Configures the PDF encryption settings.final Configuration
setErrorPolicies
(Configuration.ErrorPolicy... values) Specifies error policies that will be used for the conversion.final Configuration
setFontAliases
(Configuration.Font... values) Registers an alias font family for an existing font.final Configuration
setFontCachePath
(String value) Sets the path of the font cache.final Configuration
setFontDirectories
(String... values) Registers additional directories to load fonts from.final Configuration
setFontFallback
(String... values) Sets a list of fallback font families to be tried when none of the fonts listed using the CSS propertyfont-family
can be found.final Configuration
setFonts
(Configuration.Font... values) Loads a font from a URL which can be used via the CSS propertyfont-family
.final Configuration
setForceGrayscaleImage
(Boolean value) If the output format is an image format, this setting controls whether a grayscale image should be returned.final Configuration
setFullCompression
(Boolean value) Deprecated.final Configuration
Deprecated.final Configuration
setIgnoreAlpha
(Boolean value) Sets whether the alpha value of CSS RGBA colors is ignored.final Configuration
When enabled, makes the converted document inspectable with the PDFreactor Development Tools.final Configuration
setIntegrationStyleSheets
(Configuration.Resource... values) Adds an integration style sheet to the document.final Configuration
Specifies JavaScript related settings.final Configuration
setKeywords
(String value) Sets the value of the keywords field of the PDF document.final Configuration
setLicenseKey
(String value) Sets the license key either as content or URL.final Configuration
Deprecated as of PDFreactor 11.final Configuration
setLoggers
(Logger... values) SetsLogger
s to receive log messages.final Configuration
Sets the log level for the conversion log.final Configuration
setLogMaxLines
(Integer value) Sets the maximum amount of log entries that will be retained by the PDFreactor logs.final Configuration
Defines the value of a Media Feature which is used to resolve CSS3 media queries.final Configuration
setMediaTypes
(String... values) Sets the media types that are used to resolve CSS3 media queries.final Configuration
setMergeDocuments
(Configuration.Resource... documents) Deprecated.final Configuration
Deprecated.final Configuration
setMergeSettings
(Configuration.MergeSettings mergeSettings) Configures the PDF merge settings.final Configuration
Specifies settings for URL connections that PDFreactor establishes during the conversion to load resources.final Configuration
Sets theConfiguration.OutputFormat
.final Configuration
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.final Configuration
Deprecated.final Configuration
setOwnerPassword
(String value) Deprecated.final Configuration
Sets the page order of the direct result of the conversion.final Configuration
setPageOrder
(String value) Sets the page order of the direct result of the conversion.final Configuration
Sets the properties of a sheet on which multiple pages are being arranged.final Configuration
setPdfScriptAction
(Configuration.PdfScriptAction... values) Sets a pair of trigger event and PDF script.final Configuration
setPixelsPerInch
(Integer value) Sets the pixels per inch.final Configuration
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.final Configuration
Sets the document type after the XSL-Transformations have been applied.final Configuration
setPrintDialogPrompt
(Boolean value) Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.final Configuration
Preferences that influence the conversion process without changing the output.final Configuration
setProgressEventListeners
(ProgressEventListener... values) Adds aProgressEventListener
.final Configuration
setQuirksSettings
(Configuration.QuirksSettings quirksSettings) Allows to enable or disable behaviors that are otherwise depend on the doctype of the input document.final Configuration
setRawCookies
(Configuration.KeyValuePair... values) Deprecated.final Configuration
setRequestHeaders
(Configuration.KeyValuePair... values) Deprecated.final Configuration
setResourceConnectTimeout
(Integer value) Deprecated.final Configuration
setResourceReadTimeout
(Integer value) Deprecated.final Configuration
setSecuritySettings
(Configuration.SecuritySettings securitySettings) Specifies resource loading and document processing behavior with regards to security to protect against untrusted code or content.final Configuration
setSegmentationSettings
(Configuration.SegmentationSettings segmentationSettings) This property configures segmentation of the conversion, which helps with very large documents.final Configuration
setSignPDF
(Configuration.SignPDF value) Sets a digital certificate to sign the newly created PDF.final Configuration
setSubject
(String value) Sets the value of the subject field of the PDF document.final Configuration
Sets the value of the title field of the PDF document.final Configuration
Specifies settings for URL rewrites, which will transform URLs into others according to certain rules.final Configuration
setUserAgent
(UserAgent value) Specifies a user agent that PDFreactor will use.final Configuration
setUserPassword
(String value) Deprecated.final Configuration
setUserScripts
(Configuration.Resource... values) Adds an user script to the document.final Configuration
setUserStyleSheets
(Configuration.Resource... values) Adds a user style sheet to the document.final Configuration
setValidateConformance
(Boolean value) Enables PDFreactor to validate the generated PDF against theConfiguration.Conformance
specified viasetConformance(Conformance)
.final Configuration
Sets the page layout and page mode preferences of the PDF.final Configuration
setXmp
(Configuration.Xmp value) Sets custom XMP to be embedded into the PDF document.final Configuration
setXsltMode
(Boolean value) Enables or disables XSLT transformations.final Configuration
setXsltStyleSheets
(Configuration.Resource... values) Adds an XSLT style sheet to the document.
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
setAddAttachments
Enables or disables attachments specified in style sheets.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setDisableBookmarks
Disables bookmarks in the PDF document.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setAddBookmarks
Deprecated.Deprecated as of PDFreactor 11. Use
setDisableBookmarks(Boolean)
instead. -
setAddComments
Enables or disables comments in the PDF document.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setDisableLinks
Disables links in the PDF document.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setAddLinks
Deprecated.Deprecated as of PDFreactor 11. Use
setDisableLinks(Boolean)
instead. -
setAddOverprint
Enables or disables overprinting.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setAddPreviewImages
Enables or disables embedding of image previews per page in the PDF document.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setAddTags
Enables or disables tagging of the PDF document.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setAllowAnnotations
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowAnnotations(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowAssembly
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowAssembly(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowCopy
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowCopy(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowDegradedPrinting
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowDegradedPrinting(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowFillIn
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowFillIn(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowModifyContents
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowModifyContents(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowPrinting
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowPrinting(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAllowScreenReaders
Deprecated.Deprecated as of PDFreactor 12. Use
setAllowScreenReaders(Boolean)
instead.- Returns:
- The current
Configuration
instance.
-
setAppendLog
Specifies whether or not the log data should be added to the PDF document.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setAttachments
Adds a file attachment to PDF document.
- Returns:
- The current
Configuration
instance.
-
setAuthenticationCredentials
@Deprecated public final Configuration setAuthenticationCredentials(Configuration.KeyValuePair value) Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.NetworkSettings.setAuthenticationCredentials(HttpCredentials...)
instead. -
setAuthor
Sets the value of the author field of the PDF document.
- Returns:
- The current
Configuration
instance.
-
setBaseURL
Deprecated.Deprecated as of PDFreactor 11. Use
setBaseUrl(String)
instead. -
setBaseUrl
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
.- Returns:
- The current
Configuration
instance.
-
setBookletMode
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
- Returns:
- The current
Configuration
instance.
-
setCacheFonts
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. (seesetDisableFontRegistration(Boolean)
for more information).The default value is
false
.- Returns:
- The current
Configuration
instance. - See Also:
-
setCleanupTool
Sets the cleanup tool to use for documents with unparsable content.
The
Configuration.Cleanup
constants can be used as value. The default value specified isConfiguration.Cleanup.CYBERNEKO
.The cleanup tool is only used for
setDocumentType(Doctype)
Configuration.Doctype.XHTML
. HTML5 utilizes an internal cleanup.- Returns:
- The current
Configuration
instance. - See Also:
-
setConformance
Sets the conformance of the PDF.
The
Configuration.Conformance
constants can be used as value. The default value specified isConfiguration.Conformance.PDF
.- Returns:
- The current
Configuration
instance. - See Also:
-
setContentObserver
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 isConfiguration.ExceedingContentAnalyze.NONE
.Use
Configuration.ExceedingContentAgainst
constants to specify that exceeding this content starts exceeding content logging. The default value isConfiguration.ExceedingContentAgainst.NONE
. - Resources that could not be loaded.
- URL connection attempts made by PDFreactor.
- Returns:
- The current
Configuration
instance. - See Also:
-
-
setContinuousOutput
Enables the conversion of the input document into one image.
- Returns:
- The current
Configuration
instance.
-
setConversionName
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.
- Returns:
- The current
Configuration
instance.
-
setCookies
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.NetworkSettings.setCookies(Cookie...)
instead. -
setCssSettings
Specifies the behavior of PDFreactor regarding the support and validation of CSS properties and their declaration. The following modes can be set:
-
Do not validate at all, consider all declared style as valid. See
Configuration.CssPropertySupport.ALL
- Validate all declared styles for properties only supported by PDFreactor.
Properties only supported by third party products are not supported/taken as
invalid. See
Configuration.CssPropertySupport.HTML
- Validate all declared styles for properties supported by PDFreactor.
Properties only supported by third party products are supported/taken as valid.
See
Configuration.CssPropertySupport.HTML_THIRD_PARTY
- All properties supported by third party products are supported/taken as valid.
All declared styles for properties not supported by third party products but
supported by PDFreactor will be validated.
See
Configuration.CssPropertySupport.HTML_THIRD_PARTY_LENIENT
- Parameters:
settings
-- Returns:
- The current
Configuration
instance. - See Also:
-
Do not validate at all, consider all declared style as valid. See
-
setColorSpaceSettings
public final Configuration setColorSpaceSettings(Configuration.ColorSpaceSettings colorSpaceSettings) Specifies color space related settings.
- Returns:
- The current
Configuration
instance.
-
setCreator
Sets the value of creator field of the PDF document.
- Returns:
- The current
Configuration
instance.
-
setCustomDocumentProperties
Adds a custom property to the PDF document. An existing property of the same name will be replaced.
- Returns:
- The current
Configuration
instance.
-
setCustomUrlStreamHandlers
public final 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.- Returns:
- The current
Configuration
instance.
-
setDisableFontEmbedding
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
.- Returns:
- The current
Configuration
instance.
-
setDisableFontRegistration
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
.- Returns:
- The current
Configuration
instance.
-
setDisableSystemFonts
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
.- Returns:
- The current
Configuration
instance.
-
setDocument
The input document. This can either be a URL string, XML or HTML source code string.
- Returns:
- The current
Configuration
instance.
-
setDocument
The input document as a byte array.
- Returns:
- The current
Configuration
instance.
-
setDocument
The document as
InputSource
.- Returns:
- The current
Configuration
instance.
-
setDocumentDefaultLanguage
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.
- Returns:
- The current
Configuration
instance.
-
setDocumentType
Sets the document type.
The
Configuration.Doctype
constants can be used to specify the document type. The default value specified isConfiguration.Doctype.AUTODETECT
.- Returns:
- The current
Configuration
instance. - See Also:
-
setDebugSettings
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.
- Returns:
- The current
Configuration
instance.
-
setEncoding
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
.- Returns:
- The current
Configuration
instance.
-
setEncryption
Deprecated.Deprecated as of PDFreactor 12. Use
setEncryptionSettings(EncryptionSettings)
instead.- Returns:
- The current
Configuration
instance.
-
setErrorPolicies
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.
- Returns:
- The current
Configuration
instance.
-
setFontAliases
Registers an alias font family for an existing font.
This function is limited to fonts loaded automatically from system folders.
- Returns:
- The current
Configuration
instance.
-
setFontCachePath
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
.- Returns:
- The current
Configuration
instance.
-
setFontDirectories
Registers additional directories to load fonts from.
Fonts from subdirectories are also loaded.
- Returns:
- The current
Configuration
instance.
-
setFontFallback
Sets a list of fallback font families to be tried when none of the fonts listed using the CSS property
font-family
can be found. It is also used in cases of per character font fallback, when none of the specified fonts contain the required character.- Returns:
- The current
Configuration
instance.
-
setFonts
Loads a font from a URL which can be used via the CSS property
font-family
.- Returns:
- The current
Configuration
instance.
-
setForceGrayscaleImage
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.
- Returns:
- The current
Configuration
instance.
-
setFullCompression
Deprecated.Deprecated as of PDFreactor 12. Use
setDisablePdfStructureOptimization(Boolean)
instead. -
setDisablePdfStructureOptimization
Disables the automatic optimization and compression of the PDF structure.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setHttpsMode
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.SecuritySettings.setTrustAllConnectionCertificates(Boolean)
instead. -
setIgnoreAlpha
Sets whether the alpha value of CSS RGBA colors is ignored. This can be used to avoid conformance issues in PDF/A-1.
- Returns:
- The current
Configuration
instance.
-
setIntegrationStyleSheets
Adds an integration style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the style sheet only using an URI.
- Specifying the style sheet by the content of the style sheet and alternatively setting a URI to resolve relative elements. If no URI is specified then the system id/base URL of the document will be used.
- Returns:
- The current
Configuration
instance.
-
setJavaScriptSettings
Specifies JavaScript related settings.
- Returns:
- The current
Configuration
instance.
-
setKeywords
Sets the value of the keywords field of the PDF document.
- Returns:
- The current
Configuration
instance.
-
setLicenseKey
Sets the license key either as content or URL. If the license key is set to
null
then PDFreactor looks for a license key file 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
.- Returns:
- The current
Configuration
instance.
-
setLogger
Deprecated as of PDFreactor 11. Use
setLoggers(Logger...)
instead.- Returns:
- The current
Configuration
instance. - See Also:
-
setLoggers
Sets
Logger
s to receive log messages.Note that PDFreactor will produce log messages with a level appropriate for each logger's
Level
and not determined bysetLogLevel(LogLevel)
.- Returns:
- The current
Configuration
instance.
-
setLogMaxLines
Sets the maximum amount of log entries that will be retained by the PDFreactor logs.
The default value is 100000.
A capacity of 0 is equivalent to the default value. A negative value means that the capacity will be unlimited.
- Returns:
- The current
Configuration
instance.
-
setLogLevel
Sets the log level for the conversion log.
Use one of the
Configuration.LogLevel
constants to specify the log level.The default value is
Configuration.LogLevel.INFO
.- Returns:
- The current
Configuration
instance. - See Also:
-
setMediaFeatureValues
Defines the value of a Media Feature which is used to resolve CSS3 media queries.
- Returns:
- The current
Configuration
instance.
-
setMediaTypes
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"
- Returns:
- The current
Configuration
instance.
-
setMergeDocuments
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.MergeSettings.setDocuments(Resource...)
instead.- Returns:
- The current
Configuration
instance.
-
setMergeMode
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.MergeSettings.setMode(MergeMode)
instead.- Returns:
- The current
Configuration
instance.
-
setOutputFormat
Sets the
Configuration.OutputFormat
. If not specified, a PDF output format will be used.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.
- Returns:
- The current
Configuration
instance.
-
setOutputIntent
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.
- Returns:
- The current
Configuration
instance.
-
setOverlayRepeat
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.MergeSettings.setOverlayRepeat(OverlayRepeat)
instead.- Returns:
- The current
Configuration
instance.
-
setOwnerPassword
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setOwnerPassword(String)
instead.- Returns:
- The current
Configuration
instance.
-
setPageOrder
Sets the page order of the direct result of the conversion.
If
setMergeMode(MergeMode)
is set toConfiguration.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.
- Returns:
- The current
Configuration
instance. - See Also:
-
setPageOrder
Sets the page order of the direct result of the conversion.
If
setMergeMode(MergeMode)
is set toConfiguration.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.
- Returns:
- The current
Configuration
instance. - See Also:
-
setPagesPerSheetProperties
Sets the properties of a sheet on which multiple pages are being arranged.
If
Configuration.PagesPerSheetProperties.setCols(Integer)
orConfiguration.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 isConfiguration.PagesPerSheetDirection.RIGHT_DOWN
.- Returns:
- The current
Configuration
instance. - See Also:
-
setPdfScriptAction
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.
- Returns:
- The current
Configuration
instance.
-
setPixelsPerInch
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.- Returns:
- The current
Configuration
instance.
-
setPixelsPerInchShrinkToFit
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
- Returns:
- The current
Configuration
instance.
-
setPostTransformationDocumentType
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 isConfiguration.Doctype.AUTODETECT
.- Returns:
- The current
Configuration
instance. - See Also:
-
setPrintDialogPrompt
Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.
The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setProcessingPreferences
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.- Returns:
- The current
Configuration
instance.
-
setProgressEventListeners
Adds a
ProgressEventListener
.- Returns:
- The current
Configuration
instance.
-
setRawCookies
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.NetworkSettings.setCookies(Cookie...)
instead. -
setRequestHeaders
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.NetworkSettings.setRequestHeaders(KeyValuePair...)
instead. -
setResourceConnectTimeout
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.NetworkSettings.setConnectTimeout(Integer)
instead. -
setResourceReadTimeout
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.NetworkSettings.setReadTimeout(Integer)
instead. -
setSignPDF
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.- Returns:
- The current
Configuration
instance.
-
setSubject
Sets the value of the subject field of the PDF document.
- Returns:
- The current
Configuration
instance.
-
setTitle
Sets the value of the title field of the PDF document.
- Returns:
- The current
Configuration
instance.
-
setUserPassword
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setUserPassword(String)
instead.- Returns:
- The current
Configuration
instance.
-
setUserScripts
Adds an user script to the document.
There are two ways to specify the script:
- Specifying the script only by an URI.
- Specifying the script by the content of the script and alternatively setting a URI to resolve relative elements. If no URI is specified then the system id/base URL of the document will be used.
Supports various
Configuration.ResourceSubtype
s. Supported subtypes are:Configuration.ResourceSubtype.JAVASCRIPT_CLASSIC
,Configuration.ResourceSubtype.JAVASCRIPT_IMPORTMAP
andConfiguration.ResourceSubtype.JAVASCRIPT_MODULE
. Other values are treated asConfiguration.ResourceSubtype.JAVASCRIPT_CLASSIC
.- Returns:
- The current
Configuration
instance.
-
setUserStyleSheets
Adds a user style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the style sheet only using an URI.
- Specifying the style sheet by the content of the style sheet and alternatively setting a URI to resolve relative elements. If no URI is specified then the system id/base URL of the document will be used.
- Returns:
- The current
Configuration
instance.
-
setViewerPreferences
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.- Returns:
- The current
Configuration
instance.
-
setXmp
Sets custom XMP to be embedded into the PDF document.
If both
Configuration.Xmp.setContent(String)
andConfiguration.Xmp.setUri(String)
are not set ornull
no custom XMP is embedded. IfConfiguration.XmpPriority
is also set toConfiguration.XmpPriority.HIGH
automatic generation of required XMP is also suppressed. This may cause output PDFs to not achieve a specified conformance.- Returns:
- The current
Configuration
instance. - See Also:
-
setXsltMode
Enables or disables XSLT transformations.
Set this value to
true
to enable XSLT transformations or tofalse
to disable XSLT transformations.The default value is
false
.- Returns:
- The current
Configuration
instance.
-
setXsltStyleSheets
Adds an XSLT style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the style sheet only by an URI.
- Specifying the style sheet by the content of the style sheet and alternatively setting a URI to resolve relative elements. If no URI is specified then the system id/base URL of the document will be used.
- Returns:
- The current
Configuration
instance.
-
setValidateConformance
Enables PDFreactor to validate the generated PDF against the
Configuration.Conformance
specified viasetConformance(Conformance)
.Currently only PDF/A and PDF/UA validation is supported.
Please note that validation might take several minutes for larger documents.
- Returns:
- The current
Configuration
instance.
-
setQuirksSettings
Allows to enable or disable behaviors that are otherwise depend on the doctype of the input document.
- Returns:
- The current
Configuration
instance.
-
setInspectableSettings
When enabled, makes the converted document inspectable with the PDFreactor Development Tools.
Only works with
Configuration.OutputType.PDF
output and requires a license key.- Returns:
- The current
Configuration
instance.
-
setEncryptionSettings
public final Configuration setEncryptionSettings(Configuration.EncryptionSettings encryptionSettings) Configures the PDF encryption settings. Specify an owner password and user password to allow or restrict access to certain PDF features such as copying or modifying.
- Returns:
- The current
Configuration
instance.
-
setMergeSettings
Configures the PDF merge settings. Specify which documents should be merged and how they should be merged (i.e. by appending, prepending or using them as an overlay.
- Returns:
- The current
Configuration
instance.
-
setSecuritySettings
Specifies resource loading and document processing behavior with regards to security to protect against untrusted code or content.
- Returns:
- The current
Configuration
instance.
-
setConversionTimeout
Sets a timeout in seconds for the whole document conversion. If the timeout is exceeded, the conversion will be aborted.
A timeout of 0 or negative values mean that the conversion will never time out. This is also the default behavior if no timeout is specified.
- Returns:
- The current
Configuration
instance.
-
setUrlRewriteSettings
Specifies settings for URL rewrites, which will transform URLs into others according to certain rules.
- Returns:
- The current
Configuration
instance.
-
setNetworkSettings
Specifies settings for URL connections that PDFreactor establishes during the conversion to load resources.
- Returns:
- The current
Configuration
instance.
-
setUserAgent
Specifies a user agent that PDFreactor will use.
- Returns:
- The current
Configuration
instance.
-
setSegmentationSettings
public final Configuration setSegmentationSettings(Configuration.SegmentationSettings segmentationSettings) This property configures segmentation of the conversion, which helps with very large documents.
-