public class Configuration extends Object
This class contains all options related to the PDF or image conversion.
Only Configuration.setDocument(Object)
is required,
all other configuration settings are optional.
Modifier and Type | Class and Description |
---|---|
static class |
Configuration.Attachment
An object containing attachment data.
|
static class |
Configuration.BookletMode
An object 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.Conformance
An enum containing conformance constants.
|
static class |
Configuration.ContinuousOutput
A object containing continuous output data.
|
static class |
Configuration.CustomUrlStreamHandler
An object containing a custom URLStreamHandler for a certain protocol.
|
static class |
Configuration.Doctype
An enum containing document type constants.
|
static class |
Configuration.Encryption
An enum containing encryprion constants.
|
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
An object containing font data.
|
static class |
Configuration.HttpsMode
An enum containing HTTPS mode constants.
|
static class |
Configuration.JavaScriptMode
An enum containing JavaScript mode constants.
|
static class |
Configuration.KeystoreType
An enum containing keystore type constants.
|
static class |
Configuration.KeyValuePair
An object containing a key-value-pair.
|
static class |
Configuration.LogExceedingContent
An object 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
An object containing media feature data.
|
static class |
Configuration.MergeMode
An enum containing merge mode constants.
|
static class |
Configuration.OutputFormat
An object containing output data.
|
static class |
Configuration.OutputIntent
An object 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 object 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
An object containing data for pages per sheet properties.
|
static class |
Configuration.PdfScriptAction
An object 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.Resource
An object containing data for external resources such as style sheets.
|
static class |
Configuration.ScriptResource
Ab object containing data for external scripts.
|
static class |
Configuration.SigningMode
An enum containing signing mode constants.
|
static class |
Configuration.SignPDF
An object containing data for signing the PDF.
|
static class |
Configuration.ViewerPreferences
An object containing constants for viewer preferences.
|
static class |
Configuration.Xmp
An object containing XMP data.
|
static class |
Configuration.XmpPriority
An enum containing the priority for XMP.
|
Constructor and Description |
---|
Configuration() |
Modifier and Type | Method and Description |
---|---|
void |
setAddAttachments(Boolean value)
Enables or disables attachments specified in style sheets.
|
void |
setAddBookmarks(Boolean value)
Enables or disables bookmarks in the PDF document.
|
void |
setAddComments(Boolean value)
Enables or disables comments in the PDF document.
|
void |
setAddLinks(Boolean value)
Enables or disables links in the PDF document.
|
void |
setAddOverprint(Boolean value)
Enables or disables overprinting.
|
void |
setAddPreviewImages(Boolean value)
Enables or disables embedding of image previews per page in the PDF
document.
|
void |
setAddTags(Boolean value)
Enables or disables tagging of the PDF document.
|
void |
setAllowAnnotations(Boolean value)
Enables or disables the 'annotations' restriction in the PDF
document.
|
void |
setAllowAssembly(Boolean value)
Enables or disables the 'assembly' restriction in the PDF
document.
|
void |
setAllowCopy(Boolean value)
Enables or disables the 'copy' restriction in the PDF document.
|
void |
setAllowDegradedPrinting(Boolean value)
Enables or disables the 'degraded printing' restriction in the PDF
document.
|
void |
setAllowFillIn(Boolean value)
Enables or disables the 'fill in' restriction in the PDF document.
|
void |
setAllowModifyContents(Boolean value)
Enables or disables the 'modify contents' restriction in the PDF
document.
|
void |
setAllowPrinting(Boolean value)
Enables or disables the 'printing' restriction in the PDF
document.
|
void |
setAllowScreenReaders(Boolean value)
Enables or disables the 'screen readers' restriction in the PDF
document.
|
void |
setAppendLog(Boolean value)
Specifies whether or not the log data should be added to the
PDF document.
|
void |
setAttachments(Configuration.Attachment[] values)
Adds a file attachment to PDF document.
|
void |
setAuthenticationCredentials(Configuration.KeyValuePair value)
Enables access to resources that are secured via Basic or Digest authentication.
|
void |
setAuthor(String value)
Sets the value of the author field of the PDF document.
|
void |
setBaseURL(String value)
Sets the base URL of the document.
|
void |
setBookletMode(Configuration.BookletMode value)
Convenience method to set pages-per-sheet properties and page order
in one step to create a booklet.
|
void |
setCacheFonts(Boolean value)
Enables or disables caching of font information.
|
void |
setCleanupTool(Configuration.Cleanup value)
Sets the cleanup tool to use for documents with unparsable content.
|
void |
setConformance(Configuration.Conformance value)
Sets the conformance of the PDF.
|
void |
setContinuousOutput(Configuration.ContinuousOutput value)
Enables the conversion of the input document into one image.
|
void |
setConversionName(String value)
Sets a name for the conversion.
|
void |
setCookies(Configuration.KeyValuePair[] values)
Adds a cookie to all outgoing HTTP connections.
|
void |
setCreator(String value)
Sets the value of creator field of the PDF document.
|
void |
setCustomDocumentProperties(Configuration.KeyValuePair[] values)
Adds a custom property to the PDF document.
|
void |
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. |
void |
setDefaultColorSpace(Configuration.ColorSpace value)
Sets whether to convert color key words to CMYK instead of RGB.
|
void |
setDisableFontEmbedding(Boolean value)
Sets whether fonts will not be embedded into the resulting PDF.
|
void |
setDisableFontRegistration(Boolean value)
Enables or disables the font registration.
|
void |
setDisableSystemFonts(Boolean value)
Enables or disables the use of system fonts.
|
void |
setDocument(Object value)
The input document.
|
void |
setDocumentDefaultLanguage(String value)
Sets the language used for documents having no explicit language attribute set.
|
void |
setDocumentType(Configuration.Doctype value)
Sets the document type.
|
void |
setEnableDebugMode(Boolean value)
Enables debug mode, which adds additional information to the output.
|
void |
setEncoding(String value)
Sets the encoding of the document.
|
void |
setEncryption(Configuration.Encryption value)
Sets the encryption.
|
void |
setFontAliases(Configuration.Font[] values)
Registers an alias font family for an existing font.
|
void |
setFontCachePath(String value)
Sets the path of the font cache.
|
void |
setFontDirectories(String[] values)
Registers an additional font directory to load fonts from.
|
void |
setFontFallback(String[] values)
Sets a list of fallback font families used for character substitution.
|
void |
setFonts(Configuration.Font[] values)
Loads a font from a URL which can be used via the CSS property
font-family . |
void |
setFullCompression(Boolean value)
Enables or disables full compression of the PDF document.
|
void |
setHttpsMode(Configuration.HttpsMode value)
Sets the HTTPS mode.
|
void |
setIgnoreAlpha(Boolean value)
Sets whether the alpha value of CSS RGBA colors is ignored.
|
void |
setIntegrationStyleSheets(Configuration.Resource[] values)
Adds an integration style sheet to the document.
|
void |
setJavaScriptMode(Configuration.JavaScriptMode value)
Sets the JavaScript Mode.
|
void |
setKeywords(String value)
Sets the value of the keywords field of the PDF document.
|
void |
setLicenseKey(String value)
Sets the license key using a string.
|
void |
setLogExceedingContent(Configuration.LogExceedingContent value)
Whether to log content exceeding the page.
|
void |
setLogger(Logger value)
Sets a
Logger to receive log messages. |
void |
setLogLevel(Configuration.LogLevel value)
Sets the log level.
|
void |
setMediaFeatureValues(Configuration.MediaFeatureValue[] values)
Defines the value of a Media Feature which is used to resolve CSS3 media queries.
|
void |
setMediaTypes(String[] values)
Sets the media types that are used to resolve CSS3 media queries.
|
void |
setMergeByteArray(byte[] value)
This method sets a byte array containing an external PDF document
which will be merged with the PDF document generated by the XML source.
|
void |
setMergeByteArrays(byte[][] values)
This method sets an array of byte arrays that contain multiple external PDFs
which will be merged with the PDF document generated by the XML source.
|
void |
setMergeMode(Configuration.MergeMode value)
Sets the merge mode.
|
void |
setMergeURL(String value)
This method sets a URL of an external PDF document which will be
merged with the PDF document generated by the XML source.
|
void |
setMergeURLs(String[] values)
This method sets an array of URLs of external PDF documents which will be
merged with the PDF document generated by the XML source.
|
void |
setOutputFormat(Configuration.OutputFormat value)
Sets the output format.
|
void |
setOutputIntent(Configuration.OutputIntent value)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
|
void |
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.
|
void |
setOwnerPassword(String value)
Sets the owner password of the PDF document.
|
void |
setPageOrder(Configuration.PageOrder value)
Sets the page order of the direct result of the conversion.
|
void |
setPageOrder(String value)
Sets the page order of the direct result of the conversion.
|
void |
setPagesPerSheetProperties(Configuration.PagesPerSheetProperties value)
Sets the properties of a sheet on which multiple pages are being arranged.
|
void |
setPdfScriptAction(Configuration.PdfScriptAction[] values)
Sets a pair of trigger event and PDF script.
|
void |
setPixelsPerInch(Integer value)
Sets the pixels per inch.
|
void |
setPixelsPerInchShrinkToFit(Boolean value)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
|
void |
setPostTransformationDocumentType(Configuration.Doctype value)
Sets the document type after the XSL-Transformations have been applied.
|
void |
setPrintDialogPrompt(Boolean value)
Enables or disables a print dialog to be shown upon opening
the generated PDF document by a PDF viewer.
|
void |
setProcessingPreferences(Configuration.ProcessingPreferences[] values)
Preferences that influence the conversion process without changing
the output
|
void |
setProgressEventListeners(ProgressEventListener[] values)
Adds a
ProgressEventListener
. |
void |
setRawCookies(Configuration.KeyValuePair[] values)
Adds a cookie to all outgoing HTTP connections.
|
void |
setRequestHeaders(Configuration.KeyValuePair[] values)
Adds a request header to all outgoing HTTP connections.
|
void |
setResourceRequestTimeout(Integer value)
Sets a timeout in milliseconds for requests to resources, such as HTTP requests to
style sheets, images etc.
|
void |
setSignPDF(Configuration.SignPDF value)
Sets a digital certificate to sign the newly created PDF.
|
void |
setSubject(String value)
Sets the value of the subject field of the PDF document.
|
void |
setThrowLicenseExceptions(Boolean value)
Whether an exception should be thrown when no legal full license key is set.
|
void |
setTitle(String value)
Sets the value of the title field of the PDF document.
|
void |
setUserPassword(String value)
Sets the user password of the PDF document.
|
void |
setUserScripts(Configuration.ScriptResource[] values)
Adds an user script to the document.
|
void |
setUserStyleSheets(Configuration.Resource[] values)
Adds a user style sheet to the document.
|
void |
setViewerPreferences(Configuration.ViewerPreferences[] values)
Sets the page layout and page mode preferences of the PDF.
|
void |
setXmp(Configuration.Xmp value)
Sets custom XMP to be embedded into the PDF document.
|
void |
setXsltMode(Boolean value)
Enables or disables XSLT transformations.
|
void |
setXsltStyleSheets(Configuration.Resource[] values)
Adds an XSLT style sheet to the document.
|
public void setLogger(Logger value)
Sets a Logger
to receive log messages.
The default value is null
.
object
- The Logger
to use.public void setDocument(Object value)
public void setAddAttachments(Boolean value)
Enables or disables attachments specified in style sheets.
The default value is false
.
public void setAddBookmarks(Boolean value)
Enables or disables bookmarks in the PDF document.
The default value isfalse
.public void setAddComments(Boolean value)
Enables or disables comments in the PDF document.
The default value is false
.
public void setAddLinks(Boolean value)
Enables or disables links in the PDF document.
The default value is false
.
public void setAddOverprint(Boolean value)
Enables or disables overprinting.
The default value is false
.
public void setAddPreviewImages(Boolean value)
Enables or disables embedding of image previews per page in the PDF document.
The default value is false
.
public void setAddTags(Boolean value)
Enables or disables tagging of the PDF document.
The default value is false
.
public void setAllowAnnotations(Boolean value)
Enables or disables the 'annotations' restriction in the PDF document.
The default value is false
.
public void setAllowAssembly(Boolean value)
Enables or disables the 'assembly' restriction in the PDF document.
The default value is false
.
public void setAllowCopy(Boolean value)
Enables or disables the 'copy' restriction in the PDF document.
The default value is false
.
public void setAllowDegradedPrinting(Boolean value)
Enables or disables the 'degraded printing' restriction in the PDF document.
The default value is false
.
public void setAllowFillIn(Boolean value)
Enables or disables the 'fill in' restriction in the PDF document.
The default value is false
.
public void setAllowModifyContents(Boolean value)
Enables or disables the 'modify contents' restriction in the PDF document.
The default value is false
.
public void setAllowPrinting(Boolean value)
Enables or disables the 'printing' restriction in the PDF document.
The default value is false
.
public void setAllowScreenReaders(Boolean value)
Enables or disables the 'screen readers' restriction in the PDF document.
The default value is false
.
public void setAppendLog(Boolean value)
Specifies whether or not the log data should be added to the PDF document.
The default value is false
.
public void setAttachments(Configuration.Attachment[] values)
Adds a file attachment to PDF document.
public void setAuthenticationCredentials(Configuration.KeyValuePair value)
Enables access to resources that are secured via Basic or Digest authentication.
public void setAuthor(String value)
Sets the value of the author field of the PDF document.
public void 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
.
public void setBookletMode(Configuration.BookletMode value)
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
public void 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
.
public void setCleanupTool(Configuration.Cleanup value)
Sets the cleanup tool to use for documents with unparsable content.
The Cleanup
constants can be used as value. The
default value specified is
Configuration.Cleanup.CYBERNEKO
.
The cleanup tool is only used for
Configuration.Doctype.XHTML
.
HTML5 utilizes an internal cleanup.
public void setConformance(Configuration.Conformance value)
Sets the conformance of the PDF.
The Conformance
constants can be used as value. The default
value specified is
Configuration.Conformance.PDF
.
Configuration.Conformance.PDF
public void setContinuousOutput(Configuration.ContinuousOutput value)
public void 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.
public void 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.getRawCookies()
public void setCreator(String value)
Sets the value of creator field of the PDF document.
public void setCustomDocumentProperties(Configuration.KeyValuePair[] values)
Adds a custom property to the PDF document. An existing property of the same name will be replaced.
public void setCustomUrlStreamHandlers(Configuration.CustomUrlStreamHandler[] values)
URLStreamHandler
for the specified protocol
which will be used for all connections
to retrieve the input document and resources.public void setDefaultColorSpace(Configuration.ColorSpace value)
Sets whether to convert color key words to CMYK instead of RGB.
The ColorSpace
constants can be used as value.
The default value specified is
Configuration.ColorSpace.RGB
.
Configuration.ColorSpace.RGB
public void 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
.
public void 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
.
public void 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
.
public void 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.public void setDocumentType(Configuration.Doctype value)
Sets the document type.
The Doctype
constants can be used to specify the
document type. The default value specified is
Configuration.Doctype.AUTODETECT
.
Configuration.Doctype.AUTODETECT
public void setEnableDebugMode(Boolean value)
public void 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
.
public void setEncryption(Configuration.Encryption value)
Sets the encryption.
Use one of the Encryption
constants to specify the
encryption. The default value is
Configuration.Encryption.NONE
.
Configuration.Encryption.NONE
public void setFontAliases(Configuration.Font[] values)
Registers an alias font family for an existing font.
This function is limited to fonts loaded automatically from system folders.
public void 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
.
public void setFontDirectories(String[] values)
Registers an additional font directory to load fonts from.
Fonts from subdirectories are also loaded.
public void 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
.
public void setFonts(Configuration.Font[] values)
Loads a font from a URL which can be used via the CSS property font-family
.
public void setFullCompression(Boolean value)
Enables or disables full compression of the PDF document.
The default value is false
.
public void 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.HttpsMode.STRICT
public void setIgnoreAlpha(Boolean value)
public void setIntegrationStyleSheets(Configuration.Resource[] values)
Adds an integration style sheet to the document.
There are two ways to specify the style sheet:
public void setJavaScriptMode(Configuration.JavaScriptMode value)
Sets the JavaScript Mode.
The default value specified is
Configuration.JavaScriptMode.DISABLED
.
public void setKeywords(String value)
Sets the value of the keywords field of the PDF document.
public void setLicenseKey(String value)
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
.
public void setLogExceedingContent(Configuration.LogExceedingContent value)
Whether to log content exceeding the page.
Use ExceedingContentAnalyze
constants to specify
which kind of content should be observed for exceeding content logging.
The default value is
Configuration.ExceedingContentAnalyze.NONE
.
Use ExceedingContentAgainst
constants to specify
that exceeding this content starts exceeding content logging.
The default value is
Configuration.ExceedingContentAgainst.NONE
.
public void setLogLevel(Configuration.LogLevel value)
Sets the log level.
Use one of the LogLevel
constants to specify the log
level.
The default value is
Configuration.LogLevel.NONE
.
Configuration.LogLevel.NONE
public void setMediaFeatureValues(Configuration.MediaFeatureValue[] values)
public void 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
public void setMergeByteArray(byte[] value)
This method sets a byte array containing an external PDF document which will be merged with the PDF document generated by the XML source.
public void setMergeByteArrays(byte[][] values)
This method sets an array of byte arrays that contain multiple external PDFs which will be merged with the PDF document generated by the XML source.
public void 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
.
public void setMergeURL(String value)
This method sets a URL of an external PDF document which will be merged with the PDF document generated by the XML source.
public void setMergeURLs(String[] values)
This method sets an array of URLs of external PDF documents which will be merged with the PDF document generated by the XML source.
public void setOutputFormat(Configuration.OutputFormat value)
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.public void 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.
public void 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 OBERLAY_REPEAT_
constants to specify the
overlay repeat. The default value is
Configuration.OverlayRepeat.NONE
.
Configuration.OverlayRepeat.NONE
public void setOwnerPassword(String value)
Sets the owner password of the PDF document.
The default value is null
.
public void 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.
public void 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.
public void setPagesPerSheetProperties(Configuration.PagesPerSheetProperties value)
Sets the properties of a sheet on which multiple pages are being arranged.
If cols
or rows
is less than 1, no
pages-per-sheet processing is done. This is the case by default.
Use one of the PagesPerSheetDirection
constants to
specify the the direction. The default value is
Configuration.PagesPerSheetDirection.RIGHT_DOWN
.
public void 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.
public void 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 96ppi
.
public void setPixelsPerInchShrinkToFit(Boolean value)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
public void setPostTransformationDocumentType(Configuration.Doctype value)
Sets the document type after the XSL-Transformations have been applied.
The Doctype
constants can be used to specify the
document type. The default value specified is
Configuration.Doctype.AUTODETECT
.
Configuration.Doctype.AUTODETECT
public void 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
.
public void setProcessingPreferences(Configuration.ProcessingPreferences[] values)
Preferences that influence the conversion process without changing the output
Use the ProcessingPreferences
constants to specify the
processing preferences. By default no processing preference is set.
public void setProgressEventListeners(ProgressEventListener[] values)
Adds a
ProgressEventListener
.
public void 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.getCookies()
public void setRequestHeaders(Configuration.KeyValuePair[] values)
Adds a request header to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
public void setResourceRequestTimeout(Integer value)
Sets a timeout in milliseconds for requests to resources, such as HTTP requests to style sheets, images etc. If the server does not respond until the timeout, the request will be aborted and the resource will not be loaded.
A timeout of 0 means that the request will not time out. A negative value means that no timeout will be set. The default value is 60000 (1min).
public void 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 KeystoreType
constants to specify the keystore type.
Use the SigningMode
constants to specify the signing mode.
public void setSubject(String value)
Sets the value of the subject field of the PDF document.
public void setThrowLicenseExceptions(Boolean value)
Whether an exception should be thrown when no legal full license key is set. This allows to programmatically ensure that documents are not altered due to license issues.
The default value is false
.
public void setTitle(String value)
Sets the value of the title field of the PDF document.
public void setUserPassword(String value)
Sets the user password of the PDF document.
The default value is null
.
public void setUserScripts(Configuration.ScriptResource[] values)
Adds an user script to the document.
There are two ways to specify the script:
public void setUserStyleSheets(Configuration.Resource[] values)
Adds a user style sheet to the document.
There are two ways to specify the style sheet:
public void setViewerPreferences(Configuration.ViewerPreferences[] values)
Sets the page layout and page mode preferences of the PDF.
Use the ViewerPreferences
constants to specify the
viewer preferences. By default no viewer preference is set.
public void setXmp(Configuration.Xmp value)
Sets custom XMP to be embedded into the PDF document.
If bothcontent
and URI
are set to null
no custom XMP is embedded.
If priority
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.XmpPriority.HIGH
public void 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
.
public void setXsltStyleSheets(Configuration.Resource[] values)
Adds an XSLT style sheet to the document.
There are two ways to specify the style sheet:
This doc was generated on 2017-05-17. Copyright © 2002-2017 RealObjects GmbH. All Rights Reserved.