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
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum containing IP address types.static final classA type containing attachment data.static final classA type containing booklet mode data.static enumAn enum containing XHTML cleanup constants.static enumAn enum containing color conversion intent constants.static enumAn enum containing color space constants.static final classA type containing settings for the potential conversion of CSS colors and images into the target color space.static enumAn enum containing conformance constants.static final classA type containing security rule properties.static enumAn enum containing security rule action constants.static final classA type containing specifications on which content should be observed.static final classA type containing continuous output data.static final classAn object containing cookie data.static enumAn enum containing cookie policy constants.static enumAn enum containing CSS property support mode constants.static final classA type containing settings of how CSS properties are supported.static final classA type containing a custom URLStreamHandler for a certain protocol.static final classA type containing various options for debugging.static enumAn enum containing document type constants.static enumAn enum containing encryption constants.static final classA type containing settings related to PDF encryption.static enumAn enum containing error policies.static enumAn enum containing constants for logging exceeding content against.static enumAn enum containing constants for analyzing exceeding content.static final classA type containing font data.static enumAn enum containing HTTP authentication scheme constants.static final classAn object containing HTTP authentication credentials data.static enumAn enum containing HTTP protocol constants.static enumDeprecated.static final classA type containing settings related to inspectable documents.static enumAn enum containing JavaScript debug mode constants.static enumAn enum containing JavaScript engines.static final classA type containing settings related to JavaScript.static enumAn enum containing keystore type constants.static final classA type containing a key-value-pair.static final classA type containing data for logging exceeding content.static enumAn enum containing log level constants.static enumAn enum containing media feature constants.static final classA type containing media feature data.static enumAn enum containing merge mode constants.static final classA type containing settings related to PDF merging.static final classAn object containing network settings data.static final classA type containing output data.static final classA type containing data for an output intents.static enumAn enum containing default profiles for output intents.static enumAn enum containing output format constants.static enumAn enum containing constants that determines whether the converted document or the specified PDF document(s) is the content document for overlaying.static enumAn enum containing data to configure how overlay pages that have different dimensions from the pages they are overlaying should be resized.static enumAn enum containing data for repeating overlays.static enumAn enum containing pre-defined page orders.static enumAn enum containing constants for pages per sheet directions.static final classA type containing data for pages per sheet properties.static final classA type containing PDF script data.static enumAn enum containing trigger events for PDF scripts.static enumAn enum containing constants for processing preferences.static enumAn enum containing modes for Quirks.static final classA type containing quirks settings.static enumAn enum containing resolution units.static final classA type containing data for external resources such as style sheets.static enumAn enum containing resource sub type constants.static final classA type containing default behaviors for security settings.static final classA type containing security settings.static final classA type containing settings for segmenting input documents.static enumAn enum containing the cryptographic filter type that is used for signing.static final classA type containing data for signing the PDF.static final classA type containing various options for debugging.static final classA type containing various options for URL rewrites.static enumAn enum containing constants for viewer preferences.static final classA type containing XMP data.static enumAn enum containing the priority for XMP. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ConfigurationsetAddAttachments(Boolean value) Enables or disables attachments specified in style sheets.final ConfigurationsetAddBookmarks(Boolean value) Deprecated.final ConfigurationsetAddComments(Boolean value) Enables or disables comments in the PDF document.final ConfigurationsetAddLinks(Boolean value) Deprecated.final ConfigurationsetAddOverprint(Boolean value) Enables or disables overprinting.final ConfigurationsetAddPreviewImages(Boolean value) Deprecated.final ConfigurationsetAddTags(Boolean value) Enables or disables tagging of the PDF document.final ConfigurationsetAllowAnnotations(Boolean value) Deprecated.final ConfigurationsetAllowAssembly(Boolean value) Deprecated.final ConfigurationsetAllowCopy(Boolean value) Deprecated.final ConfigurationsetAllowDegradedPrinting(Boolean value) Deprecated.final ConfigurationsetAllowFillIn(Boolean value) Deprecated.final ConfigurationsetAllowModifyContents(Boolean value) Deprecated.final ConfigurationsetAllowPrinting(Boolean value) Deprecated.final ConfigurationsetAllowScreenReaders(Boolean value) Deprecated.final ConfigurationsetAppendLog(Boolean value) Specifies whether or not the log data should be added to the PDF document.final ConfigurationsetAttachments(Configuration.Attachment... values) Adds a file attachment to PDF document.final ConfigurationDeprecated.final ConfigurationSets the value of the author field of the PDF document.final ConfigurationsetBaseUrl(String value) Sets the base URL of the document.final ConfigurationsetBaseURL(String value) Deprecated.final ConfigurationConvenience method to set pages-per-sheet properties and page order in one step to create a booklet.final ConfigurationsetCacheFonts(Boolean value) Enables or disables caching of font information.final ConfigurationSets the cleanup tool to use for non-well-formed XHTML documents.final ConfigurationsetColorSpaceSettings(Configuration.ColorSpaceSettings colorSpaceSettings) Specifies color space related settings.final ConfigurationSets the conformance of the PDF.final ConfigurationSpecifies parts of the document's content that should be observed and logged in greater detail.final ConfigurationEnables the conversion of the input document into one image.final ConfigurationsetConversionName(String value) Sets a name for the conversion.final ConfigurationsetConversionTimeout(Integer value) Sets a timeout in seconds for the whole document conversion.final ConfigurationsetCookies(Configuration.KeyValuePair... values) Deprecated.final ConfigurationsetCreator(String value) Sets the value of creator field of the PDF document.final ConfigurationsetCssSettings(Configuration.CssSettings settings) Specifies the behavior of PDFreactor regarding the support and validation of CSS properties and their declaration.final ConfigurationAdds a custom property to the PDF document.final ConfigurationAdds aURLStreamHandlerfor the specified protocol which will be used for all connections to retrieve the input document and resources.final ConfigurationEnables and configures debug settings, which add additional information to the output.final ConfigurationsetDisableBookmarks(Boolean value) Disables bookmarks in the PDF document.final ConfigurationsetDisableFontEmbedding(Boolean value) Sets whether fonts will not be embedded into the resulting PDF.final ConfigurationEnables or disables the font registration.final ConfigurationsetDisableLinks(Boolean value) Disables links in the PDF document.final ConfigurationDisables the automatic optimization and compression of the PDF structure.final ConfigurationsetDisableSystemFonts(Boolean value) Enables or disables the use of system fonts.final ConfigurationsetDocument(byte[] value) The input document as a byte array.final ConfigurationsetDocument(String value) The input document.final ConfigurationsetDocument(InputSource value) The document asInputSource.final ConfigurationsetDocumentDefaultLanguage(String value) Sets the language used for documents having no explicit language attribute set.final ConfigurationSets the document type.final ConfigurationsetEncoding(String value) Sets the encoding of the document.final ConfigurationDeprecated.final ConfigurationsetEncryptionSettings(Configuration.EncryptionSettings encryptionSettings) Configures the PDF encryption settings.final ConfigurationsetErrorPolicies(Configuration.ErrorPolicy... values) Specifies error policies that will be used for the conversion.final ConfigurationsetFontAliases(Configuration.Font... values) Registers an alias font family for an existing font.final ConfigurationsetFontCachePath(String value) Sets the path of the font cache.final ConfigurationsetFontDirectories(String... values) Registers additional directories to load fonts from.final ConfigurationsetFontFallback(String... values) Sets a list of fallback font families to be tried when none of the fonts listed using the CSS propertyfont-familycan be found.final ConfigurationsetFonts(Configuration.Font... values) Loads a font from a URL which can be used via the CSS propertyfont-family.final ConfigurationsetForceGrayscaleImage(Boolean value) If the output format is an image format, this setting controls whether a grayscale image should be returned.final ConfigurationsetFullCompression(Boolean value) Deprecated.final ConfigurationDeprecated.final ConfigurationsetIgnoreAlpha(Boolean value) Sets whether the alpha value of CSS RGBA colors is ignored.final ConfigurationWhen enabled, makes the converted document inspectable with the PDFreactor Development Tools.final ConfigurationsetIntegrationStyleSheets(Configuration.Resource... values) Adds an integration style sheet to the document.final ConfigurationSpecifies JavaScript related settings.final ConfigurationsetKeywords(String value) Sets the value of the keywords field of the PDF document.final ConfigurationsetLicenseKey(String value) Sets the license key either as content or URL.final ConfigurationDeprecated as of PDFreactor 11.final ConfigurationsetLoggers(Logger... values) SetsLoggers to receive log messages.final ConfigurationSets the log level for the conversion log.final ConfigurationsetLogMaxLines(Integer value) Sets the maximum amount of log entries that will be retained by the PDFreactor logs.final ConfigurationDefines the value of a Media Feature which is used to resolve CSS3 media queries.final ConfigurationsetMediaTypes(String... values) Sets the media types that are used to resolve CSS3 media queries.final ConfigurationsetMergeDocuments(Configuration.Resource... documents) Deprecated.final ConfigurationDeprecated.final ConfigurationsetMergeSettings(Configuration.MergeSettings mergeSettings) Configures the PDF merge settings.final ConfigurationSpecifies settings for URL connections that PDFreactor establishes during the conversion to load resources.final ConfigurationSets theConfiguration.OutputFormat.final ConfigurationSets the output intent including the identifier and the ICC profile to be embedded into the PDF.final ConfigurationDeprecated.final ConfigurationsetOwnerPassword(String value) Deprecated.final ConfigurationSets the page order of the direct result of the conversion.final ConfigurationsetPageOrder(String value) Sets the page order of the direct result of the conversion.final ConfigurationSets the properties of a sheet on which multiple pages are being arranged.final ConfigurationsetPdfScriptAction(Configuration.PdfScriptAction... values) Sets a pair of trigger event and PDF script.final ConfigurationsetPixelsPerInch(Integer value) Sets the pixels per inch.final ConfigurationWhether the pixels per inch should be adapted automatically to avoid content exceeding pages.final ConfigurationSets the document type after the XSL-Transformations have been applied.final ConfigurationsetPrintDialogPrompt(Boolean value) Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.final ConfigurationPreferences that influence the conversion process without changing the output.final ConfigurationsetProgressEventListeners(ProgressEventListener... values) Adds aProgressEventListener.final ConfigurationsetQuirksSettings(Configuration.QuirksSettings quirksSettings) Allows to enable or disable behaviors that are otherwise depend on the doctype of the input document.final ConfigurationsetRawCookies(Configuration.KeyValuePair... values) Deprecated.final ConfigurationsetRequestHeaders(Configuration.KeyValuePair... values) Deprecated.final ConfigurationsetResourceConnectTimeout(Integer value) Deprecated.final ConfigurationsetResourceReadTimeout(Integer value) Deprecated.final ConfigurationsetSecuritySettings(Configuration.SecuritySettings securitySettings) Specifies resource loading and document processing behavior with regards to security to protect against untrusted code or content.final ConfigurationsetSegmentationSettings(Configuration.SegmentationSettings segmentationSettings) This property configures segmentation of the conversion, which helps with very large documents.final ConfigurationsetSignPDF(Configuration.SignPDF value) Sets a digital certificate to sign the newly created PDF.final ConfigurationsetSubject(String value) Sets the value of the subject field of the PDF document.final ConfigurationSets the value of the title field of the PDF document.final ConfigurationSpecifies settings for URL rewrites, which will transform URLs into others according to certain rules.final ConfigurationsetUserAgent(UserAgent value) Specifies a user agent that PDFreactor will use.final ConfigurationsetUserPassword(String value) Deprecated.final ConfigurationsetUserScripts(Configuration.Resource... values) Adds an user script to the document.final ConfigurationsetUserStyleSheets(Configuration.Resource... values) Adds a user style sheet to the document.final ConfigurationsetValidateConformance(Boolean value) Enables PDFreactor to validate the generated PDF against theConfiguration.Conformancespecified viasetConformance(Conformance).final ConfigurationSets the page layout and page mode preferences of the PDF.final ConfigurationsetXmp(Configuration.Xmp value) Sets custom XMP to be embedded into the PDF document.final ConfigurationsetXsltMode(Boolean value) Enables or disables XSLT transformations.final ConfigurationsetXsltStyleSheets(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
Configurationinstance.
-
setDisableBookmarks
Disables bookmarks in the PDF document.
The default value is
false.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setDisableLinks
Disables links in the PDF document.
The default value is
false.- Returns:
- The current
Configurationinstance.
-
setAddLinks
Deprecated.Deprecated as of PDFreactor 11. Use
setDisableLinks(Boolean)instead. -
setAddOverprint
Enables or disables overprinting.
The default value is
false.- Returns:
- The current
Configurationinstance.
-
setAddPreviewImages
Deprecated.Enables or disables embedding of image previews per page in the PDF document.
The default value is
false.This functionality is deprecated for removal in Q4 2025. Specifying it will then have no effect.
- Returns:
- The current
Configurationinstance.
-
setAddTags
Enables or disables tagging of the PDF document.
The default value is
false.- Returns:
- The current
Configurationinstance.
-
setAllowAnnotations
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowAnnotations(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowAssembly
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowAssembly(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowCopy
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowCopy(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowDegradedPrinting
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowDegradedPrinting(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowFillIn
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowFillIn(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowModifyContents
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowModifyContents(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowPrinting
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowPrinting(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAllowScreenReaders
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setAllowScreenReaders(Boolean)instead.- Returns:
- The current
Configurationinstance.
-
setAppendLog
Specifies whether or not the log data should be added to the PDF document.
The default value is
false.- Returns:
- The current
Configurationinstance.
-
setAttachments
Adds a file attachment to PDF document.
- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
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
nullthen it will be used instead of the system id.The default value is
null.- Returns:
- The current
Configurationinstance.
-
setBookletMode
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
- Returns:
- The current
Configurationinstance.
-
setCacheFonts
Enables or disables caching of font information.
During the PDF creation
PDFreactorrequires 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
PDFreactoron 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
Configurationinstance. - See Also:
-
setCleanupTool
Sets the cleanup tool to use for non-well-formed XHTML documents.
The default is
Configuration.Cleanup.CYBERNEKO.Note:
Configuration.Cleanup.JTIDYandConfiguration.Cleanup.TAGSOUPare deprecated for removal in Q4 2025. Specifying either will then default toConfiguration.Cleanup.CYBERNEKO.The cleanup tool is only used for
doctypeXHTML.HTMLis parsed according to the HTML specification.- Returns:
- The current
Configurationinstance. - See Also:
-
setConformance
Sets the conformance of the PDF.
The
Configuration.Conformanceconstants can be used as value. The default value specified isConfiguration.Conformance.PDF.- Returns:
- The current
Configurationinstance. - 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.ExceedingContentAnalyzeconstants to specify which kind of content should be observed for exceeding content logging. The default value isConfiguration.ExceedingContentAnalyze.NONE.Use
Configuration.ExceedingContentAgainstconstants 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
Configurationinstance. - See Also:
-
-
setContinuousOutput
Enables the conversion of the input document into one image.
- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance. - 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
Configurationinstance.
-
setCreator
Sets the value of creator field of the PDF document.
- Returns:
- The current
Configurationinstance.
-
setCustomDocumentProperties
Adds a custom property to the PDF document. An existing property of the same name will be replaced.
- Returns:
- The current
Configurationinstance.
-
setCustomUrlStreamHandlers
public final Configuration setCustomUrlStreamHandlers(Configuration.CustomUrlStreamHandler... values) Adds a
URLStreamHandlerfor the specified protocol which will be used for all connections to retrieve the input document and resources.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
setDocument
The input document. This can either be a URL string, XML or HTML source code string.
- Returns:
- The current
Configurationinstance.
-
setDocument
The input document as a byte array.
- Returns:
- The current
Configurationinstance.
-
setDocument
The document as
InputSource.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setDocumentType
Sets the document type.
The
Configuration.Doctypeconstants can be used to specify the document type. The default value specified isConfiguration.Doctype.AUTODETECT.- Returns:
- The current
Configurationinstance. - 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
Configurationinstance.
-
setEncoding
Sets the encoding of the document.
If this value is set to
nullor it is empty then the encoding will be detected automatically.The default value is
null.- Returns:
- The current
Configurationinstance.
-
setEncryption
Deprecated.Deprecated as of PDFreactor 12. Use
setEncryptionSettings(EncryptionSettings)instead.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setFontAliases
Registers an alias font family for an existing font.
This function is limited to fonts loaded automatically from system folders.
- Returns:
- The current
Configurationinstance.
-
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
nullthen the "user.home" directory will be used.The default value is
null.- Returns:
- The current
Configurationinstance.
-
setFontDirectories
Registers additional directories to load fonts from.
Fonts from subdirectories are also loaded.
- Returns:
- The current
Configurationinstance.
-
setFontFallback
Sets a list of fallback font families to be tried when none of the fonts listed using the CSS property
font-familycan 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
Configurationinstance.
-
setFonts
Loads a font from a URL which can be used via the CSS property
font-family.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
setJavaScriptSettings
Specifies JavaScript related settings.
- Returns:
- The current
Configurationinstance.
-
setKeywords
Sets the value of the keywords field of the PDF document.
- Returns:
- The current
Configurationinstance.
-
setLicenseKey
Sets the license key either as content or URL. If the license key is set to
nullthen 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
Configurationinstance.
-
setLogger
Deprecated as of PDFreactor 11. Use
setLoggers(Logger...)instead.- Returns:
- The current
Configurationinstance. - See Also:
-
setLoggers
Sets
Loggers to receive log messages.Note that PDFreactor will produce log messages with a level appropriate for each logger's
Leveland not determined bysetLogLevel(LogLevel).- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setLogLevel
Sets the log level for the conversion log.
Use one of the
Configuration.LogLevelconstants to specify the log level.The default value is
Configuration.LogLevel.INFO.- Returns:
- The current
Configurationinstance. - See Also:
-
setMediaFeatureValues
Defines the value of a Media Feature which is used to resolve CSS3 media queries.
- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setMergeDocuments
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.MergeSettings.setDocuments(Resource...)instead.- Returns:
- The current
Configurationinstance.
-
setMergeMode
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.MergeSettings.setMode(MergeMode)instead.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
setOverlayRepeat
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.MergeSettings.setOverlayRepeat(OverlayRepeat)instead.- Returns:
- The current
Configurationinstance.
-
setOwnerPassword
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setOwnerPassword(String)instead.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance. - 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
Configurationinstance. - 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.PagesPerSheetDirectionconstants to specify the the direction. The default value isConfiguration.PagesPerSheetDirection.RIGHT_DOWN.- Returns:
- The current
Configurationinstance. - 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
Configurationinstance.
-
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
96ppi.- Returns:
- The current
Configurationinstance.
-
setPixelsPerInchShrinkToFit
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
- Returns:
- The current
Configurationinstance.
-
setPostTransformationDocumentType
Sets the document type after the XSL-Transformations have been applied.
The
Configuration.Doctypeconstants can be used to specify the document type. The default value specified isConfiguration.Doctype.AUTODETECT.- Returns:
- The current
Configurationinstance. - 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
Configurationinstance.
-
setProcessingPreferences
Preferences that influence the conversion process without changing the output.
Use the
Configuration.ProcessingPreferencesconstants to specify the processing preferences. By default no processing preference is set.- Returns:
- The current
Configurationinstance.
-
setProgressEventListeners
Adds a
ProgressEventListener.- Returns:
- The current
Configurationinstance.
-
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.KeystoreTypeconstants to specify the keystore type.Use the
Configuration.SigningModeconstants to specify the cryptographic filter that is used for signing.- Returns:
- The current
Configurationinstance.
-
setSubject
Sets the value of the subject field of the PDF document.
- Returns:
- The current
Configurationinstance.
-
setTitle
Sets the value of the title field of the PDF document.
- Returns:
- The current
Configurationinstance.
-
setUserPassword
Deprecated.Deprecated as of PDFreactor 12. Use
Configuration.EncryptionSettings.setUserPassword(String)instead.- Returns:
- The current
Configurationinstance.
-
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.ResourceSubtypes. Supported subtypes are:Configuration.ResourceSubtype.JAVASCRIPT_CLASSIC,Configuration.ResourceSubtype.JAVASCRIPT_IMPORTMAPandConfiguration.ResourceSubtype.JAVASCRIPT_MODULE. Other values are treated asConfiguration.ResourceSubtype.JAVASCRIPT_CLASSIC.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setViewerPreferences
Sets the page layout and page mode preferences of the PDF.
Use the
Configuration.ViewerPreferencesconstants to specify the viewer preferences. By default no viewer preference is set.- Returns:
- The current
Configurationinstance.
-
setXmp
Sets custom XMP to be embedded into the PDF document.
If both
Configuration.Xmp.setContent(String)andConfiguration.Xmp.setUri(String)are not set ornullno custom XMP is embedded. IfConfiguration.XmpPriorityis also set toConfiguration.XmpPriority.HIGHautomatic generation of required XMP is also suppressed. This may cause output PDFs to not achieve a specified conformance.- Returns:
- The current
Configurationinstance. - See Also:
-
setXsltMode
Enables or disables XSLT transformations.
Set this value to
trueto enable XSLT transformations or tofalseto disable XSLT transformations.The default value is
false.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setValidateConformance
Enables PDFreactor to validate the generated PDF against the
Configuration.Conformancespecified 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
Configurationinstance.
-
setQuirksSettings
Allows to enable or disable behaviors that are otherwise depend on the doctype of the input document.
- Returns:
- The current
Configurationinstance.
-
setInspectableSettings
When enabled, makes the converted document inspectable with the PDFreactor Development Tools.
Only works with
Configuration.OutputType.PDFoutput and requires a license key.- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
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
Configurationinstance.
-
setSecuritySettings
Specifies resource loading and document processing behavior with regards to security to protect against untrusted code or content.
- Returns:
- The current
Configurationinstance.
-
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
Configurationinstance.
-
setUrlRewriteSettings
Specifies settings for URL rewrites, which will transform URLs into others according to certain rules.
- Returns:
- The current
Configurationinstance.
-
setNetworkSettings
Specifies settings for URL connections that PDFreactor establishes during the conversion to load resources.
- Returns:
- The current
Configurationinstance.
-
setUserAgent
Specifies a user agent that PDFreactor will use.
- Returns:
- The current
Configurationinstance.
-
setSegmentationSettings
public final Configuration setSegmentationSettings(Configuration.SegmentationSettings segmentationSettings) This property configures segmentation of the conversion, which helps with very large documents.
-