PDFreactor Ruby API Documentation

Java | .NET | JavaScript | Node.js | PHP | Python | Ruby | Web Service Client | SOAP Client

Server Parameters

PDFreactor

The PDFreactor object handles all interaction with the PDFreactor Web Service. Only one instance per web service is required and the instance is reusable for subsequent conversions. The following describes the methods that can be called on the PDFreactor instance.

PDFreactor()

Creates a new PDFreactor client instance. The PDFreactor Web Service URL http://localhost:9423/service/rest will be used.

PDFreactor(serviceUrl)

Creates a new PDFreactor client instance. The specified URL will be used as PDFreactor Web Service URL.

Parameters

serviceUrl → String
The URL to the PDFreactor Web Service.

convert(configuration, connectionSettings) → Result

Converts the specified configuration into PDF or image.

Parameters

configuration → Configuration
The configuration.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::ConversionFailureError
The configuration could not be processed and should be re-checked.
PDFreactor::InvalidClientError
The version of the client that was used is outdated and no longer supported. This is only available for the PDFreactor REST clients.
PDFreactor::InvalidConfigurationError
The supplied configuration was not valid for some reason. See the error message for details.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::NoConfigurationError
No configuration was supplied to the operation.
PDFreactor::NoInputDocumentError
No input document was specified in the configuration.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

convertAsBinary(configuration, connectionSettings) → Binary

Converts the specified configuration into PDF or image and returns the generated PDF or image.

Parameters

configuration → Configuration
The configuration.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::ConversionFailureError
The configuration could not be processed and should be re-checked.
PDFreactor::InvalidClientError
The version of the client that was used is outdated and no longer supported. This is only available for the PDFreactor REST clients.
PDFreactor::InvalidConfigurationError
The supplied configuration was not valid for some reason. See the error message for details.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::NoConfigurationError
No configuration was supplied to the operation.
PDFreactor::NoInputDocumentError
No input document was specified in the configuration.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

convertAsBinary(configuration, stream, connectionSettings)

Converts the specified configuration into PDF or image. Writes the result in the specified stream.

Parameters

configuration → Configuration
The configuration.
stream → IO
The stream to write the resulting document to.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::ConversionFailureError
The configuration could not be processed and should be re-checked.
PDFreactor::InvalidClientError
The version of the client that was used is outdated and no longer supported. This is only available for the PDFreactor REST clients.
PDFreactor::InvalidConfigurationError
The supplied configuration was not valid for some reason. See the error message for details.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::NoConfigurationError
No configuration was supplied to the operation.
PDFreactor::NoInputDocumentError
No input document was specified in the configuration.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

convertAsync(configuration, connectionSettings) → String

Converts the specified configuration into PDF or image. This operation responds immediately and does not wait for the conversion to finish. This is especially useful for very large or complex documents where the conversion will take some time.

Parameters

configuration → Configuration
The configuration.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::AsyncUnavailableError
Asynchronous conversions are not available in this PDFreactor Web Service.
PDFreactor::InvalidClientError
The version of the client that was used is outdated and no longer supported. This is only available for the PDFreactor REST clients.
PDFreactor::InvalidConfigurationError
The supplied configuration was not valid for some reason. See the error message for details.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::NoConfigurationError
No configuration was supplied to the operation.
PDFreactor::NoInputDocumentError
No input document was specified in the configuration.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

convertAssetPackage(assetPackage, connectionSettings) → Result

Converts the specified Asset Package into PDF or image.

Parameters

assetPackage → IO
The stream to read the Asset Package from.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

convertAssetPackageAsBinary(assetPackage, connectionSettings) → Binary

Converts the specified asset package into PDF or image and returns the generated PDF or image.

Parameters

assetPackage → IO
The stream to read the Asset Package from.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

convertAssetPackageAsBinary(assetPackage, stream, connectionSettings)

Converts the specified asset package into PDF or image. Writes the result in the specified stream.

Parameters

assetPackage → IO
The stream to read the Asset Package from.
stream → IO
The stream to write the resulting document to.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

convertAssetPackageAsync(assetPackage, connectionSettings) → String

Converts the specified asset package into PDF or image. This operation responds immediately and does not wait for the conversion to finish. This is especially useful for very large or complex documents where the conversion will take some time.

Parameters

assetPackage → IO
The stream to read the Asset Package from.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

getProgress(documentId, connectionSettings) → Progress

Retrieves progress information about the asynchronous conversion with the given ID.

Parameters

documentId → String
The documentId.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::DocumentNotFoundError
Conversion does not exist.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getDocument(documentId, connectionSettings) → Result

Retrieves the asynchronously converted document with the given ID.

Parameters

documentId → String
The document ID.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::DocumentNotFoundError
Conversion does not exist.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getDocumentMetadata(documentId, connectionSettings) → Result

Retrieves the metadata of the asynchronously converted document with the given ID.

Parameters

documentId → String
The document ID.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::DocumentNotFoundError
Conversion does not exist.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getDocumentAsBinary(documentId, connectionSettings) → Binary

Retrieves the asynchronously converted document with the given ID.

Parameters

documentId → String
The document ID.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::DocumentNotFoundError
Conversion does not exist.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getDocumentAsBinary(documentId, stream, connectionSettings)

Retrieves the asynchronously converted document with the given ID. Writes the result in the specified stream.

Parameters

documentId → String
The document ID.
stream → IO
The stream to write the resulting document to.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::ConversionAbortedError
The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.
PDFreactor::DocumentNotFoundError
Conversion does not exist.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnprocessableConfigurationError
The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getDocumentPageAsBinary(documentId, pageNumber, connectionSettings) → Binary

Retrieves the asynchronously converted page of a multi-image with the given ID and page number.

Parameters

documentId → String
The document ID.
pageNumber → Integer
The page number.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

getDocumentPageAsBinary(documentId, pageNumber, stream, connectionSettings)

Retrieves the asynchronously converted page of a multi-image with the given ID and page number. Writes the result in the specified stream.

Parameters

documentId → String
The document ID.
pageNumber → Integer
The page number.
stream → IO
The stream to write the resulting document to.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

deleteDocument(documentId, connectionSettings)

Deletes the asynchronously converted document with the given ID. If the conversion is still running, it gets terminated.

Parameters

documentId → String
The document ID.
connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::DocumentNotFoundError
Conversion does not exist.
PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getStatus(connectionSettings)

Checks if the PDFreactor Web Service is available and functional.

Parameters

connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getVersion(connectionSettings) → Version

Returns the version of the PDFreactor Web Service that is currently running.

Parameters

connectionSettings → ConnectionSettings
An object containing optional settings for the communication between client and PDFreactor Web Service.

Errors

PDFreactor::InvalidServiceError
A response was received but it could not be identified as a response from the PDFreactor Web Service.
PDFreactor::ServerError
The actual exception type could not be recognized.
PDFreactor::ServiceUnavailableError
The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.
PDFreactor::UnauthorizedError
The client failed an authorization check, e.g. because a supplied API key was invalid.
PDFreactor::UnreachableServiceError
The PDFreactor Web Service could not be reached.

getDocumentUrl(documentId) → String

Returns the URL where the document with the given ID can be accessed.

Parameters

documentId → String
The document ID.

getProgressUrl(documentId) → String

Returns the URL where the progress of the document with the given ID can be accessed.

Parameters

documentId → String
The document ID.

apiKey → String

The API key. Only required if the PDFreactor Web Service is so configured that only clients with a valid API key can access it.

Models

Configuration

This class contains all options related to the PDF or image conversion. Only Configuration.document or Configuration.document is required, all other configuration settings are optional.

addAttachments → Boolean

Enables or disables attachments specified in style sheets.

The default value is false.

addBookmarks → Boolean

Deprecated

Deprecated as of PDFreactor 11. Use Configuration.disableBookmarks instead.

addComments → Boolean

Enables or disables comments in the PDF document.

The default value is false.

Deprecated

Deprecated as of PDFreactor 11. Use Configuration.disableLinks instead.

addOverprint → Boolean

Enables or disables overprinting.

The default value is false.

addPreviewImages → Boolean

Enables or disables embedding of image previews per page in the PDF document.

The default value is false.

addTags → Boolean

Enables or disables tagging of the PDF document.

The default value is false.

allowAnnotations → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowAnnotations instead.

allowAssembly → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowAssembly instead.

allowCopy → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowCopy instead.

allowDegradedPrinting → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowDegradedPrinting instead.

allowFillIn → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowFillIn instead.

allowModifyContents → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowModifyContents instead.

allowPrinting → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowPrinting instead.

allowScreenReaders → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::allowScreenReaders instead.

appendLog → Boolean

Specifies whether or not the log data should be added to the PDF document.

The default value is false.

attachments → Array(Attachment)

Adds a file attachment to PDF document.

authenticationCredentials → KeyValuePair

Deprecated

Deprecated as of PDFreactor 12. Use NetworkSettings::authenticationCredentials instead.

author → String

Sets the value of the author field of the PDF document.

baseURL → String

Deprecated

Deprecated as of PDFreactor 11. Use Configuration.baseUrl instead.

baseUrl → String

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.

bookletMode → BookletMode

Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.

callbacks → Array(Callback)

Adds callbacks to the conversion which will be called at specific times. All callbacks perform a POST request to the specified URL with the specified content type and a certain model which depends on the callback event.

For each callback, you can specify a timeout. If no timeout is specified, the server's default timeout for callbacks is used. A value of zero or negative values indicate an infinite timeout, however the PDFreactor server may have a maximum timeout configured, in which case that will be the used value.

Some callbacks might be called regularly during the course of a conversion. For these callbacks you can specify an interval to control how frequently they are called.

cleanupTool → Cleanup

Sets the cleanup tool to use for documents with unparsable content.

The Cleanup constants can be used as value. The default value specified is Cleanup::CYBERNEKO.

The cleanup tool is only used for Configuration.documentType Doctype::XHTML. HTML5 utilizes an internal cleanup.

colorSpaceSettings → ColorSpaceSettings

Specifies color space related settings.

conformance → Conformance

Sets the conformance of the PDF.

The Conformance constants can be used as value. The default value specified is Conformance::PDF.

contentObserver → ContentObserver

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:

continuousOutput → ContinuousOutput

Enables the conversion of the input document into one image.

conversionName → String

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.

conversionTimeout → Integer

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.

cookies → Array(KeyValuePair)

Deprecated

Deprecated as of PDFreactor 12. Use NetworkSettings::cookies instead.

creator → String

Sets the value of creator field of the PDF document.

cssSettings → CssSettings

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 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 CssPropertySupport::HTML
  • Validate all declared styles for properties supported by PDFreactor. Properties only supported by third party products are supported/taken as valid. See 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 CssPropertySupport::HTML_THIRD_PARTY_LENIENT
customDocumentProperties → Array(KeyValuePair)

Adds a custom property to the PDF document. An existing property of the same name will be replaced.

debugSettings → DebugSettings

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.

disableBookmarks → Boolean

Disables bookmarks in the PDF document.

The default value is false.

disableFontEmbedding → Boolean

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.

Disables links in the PDF document.

The default value is false.

disablePdfStructureOptimization → Boolean

Disables the automatic optimization and compression of the PDF structure.

The default value is false.

document → Base64 | String

The input document. This can either be a URL string, XML or HTML source code string.

Alternatively, the input document can be specified directly as Base64.
documentDefaultLanguage → String

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.

documentType → Doctype

Sets the document type.

The Doctype constants can be used to specify the document type. The default value specified is Doctype::AUTODETECT.

encoding → String

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.

encryption → Encryption

Deprecated

Deprecated as of PDFreactor 12. Use Configuration.encryptionSettings instead.

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.

errorPolicies → Array(ErrorPolicy)

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.

fontAliases → Array(Font)

Registers an alias font family for an existing font.

This function is limited to fonts loaded automatically from system folders.

fontFallback → Array(String)

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.

fonts → Array(Font)

Loads a font from a URL which can be used via the CSS property font-family.

forceGrayscaleImage → Boolean

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.

fullCompression → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use Configuration.disablePdfStructureOptimization instead.

httpsMode → HttpsMode

Deprecated

Deprecated as of PDFreactor 12. Use SecuritySettings::trustAllConnectionCertificates instead.

ignoreAlpha → Boolean

Sets whether the alpha value of CSS RGBA colors is ignored. This can be used to avoid conformance issues in PDF/A-1.

inspectableSettings → InspectableSettings

When enabled, makes the converted document inspectable with the PDFreactor Development Tools.

Only works with OutputType::PDF output and requires a license key.

integrationStyleSheets → Array(Resource)

Adds an integration style sheet to the document.

There are two ways to specify the style sheet:

  1. Specifying the style sheet only using an URI.
  2. 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.
javaScriptSettings → JavaScriptSettings

Specifies JavaScript related settings.

keepDocument → Boolean

If set to true prevents the document from being deleted from the PDFreactor Web Service after it has been accessed. This only works for asynchronous conversions.

keywords → String

Sets the value of the keywords field of the PDF document.

licenseKey → String

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.

logLevel → LogLevel

Sets the log level for the conversion log.

Use one of the LogLevel constants to specify the log level.

The default value is LogLevel::INFO.

logMaxLines → Integer

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.

mediaFeatureValues → Array(MediaFeatureValue)

Defines the value of a Media Feature which is used to resolve CSS3 media queries.

mediaTypes → Array(String)

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"

mergeDocuments → Array(Resource)

Deprecated

Deprecated as of PDFreactor 12. Use MergeSettings::documents instead.

mergeMode → MergeMode

Deprecated

Deprecated as of PDFreactor 12. Use MergeSettings::mode instead.

mergeSettings → MergeSettings

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.

networkSettings → NetworkSettings

Specifies settings for URL connections that PDFreactor establishes during the conversion to load resources.

outputFormat → OutputFormat

Sets the 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.

outputIntent → OutputIntent

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.

overlayRepeat → OverlayRepeat

Deprecated

Deprecated as of PDFreactor 12. Use MergeSettings::overlayRepeat instead.

ownerPassword → String

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::ownerPassword instead.

pageOrder → PageOrder | String

Sets the page order of the direct result of the conversion.

If Configuration.mergeMode is set to 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.

pagesPerSheetProperties → PagesPerSheetProperties

Sets the properties of a sheet on which multiple pages are being arranged.

If PagesPerSheetProperties::cols or PagesPerSheetProperties::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 PagesPerSheetDirection::RIGHT_DOWN.

pdfScriptAction → Array(PdfScriptAction)

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.

pixelsPerInch → Integer

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.

pixelsPerInchShrinkToFit → Boolean

Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.

postTransformationDocumentType → Doctype

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 Doctype::AUTODETECT.

printDialogPrompt → Boolean

Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.

The default value is false.

processingPreferences → Array(ProcessingPreferences)

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.

quirksSettings → QuirksSettings

Allows to enable or disable behaviors that are otherwise depend on the doctype of the input document.

rawCookies → Array(KeyValuePair)

Deprecated

Deprecated as of PDFreactor 12. Use NetworkSettings::cookies instead.

requestHeaders → Array(KeyValuePair)

Deprecated

Deprecated as of PDFreactor 12. Use NetworkSettings::requestHeaders instead.

requestPriority → Integer

Specifies the priority of the conversion request. A higher priority means that the web service will adjust the conversion's position in the queue appropriately, so that it is converted before others with lower priority.

By default, asynchronous conversions have a priority of 0, synchronous conversions have a priority of 10.

resourceConnectTimeout → Integer

Deprecated

Deprecated as of PDFreactor 12. Use NetworkSettings::connectTimeout instead.

resourceReadTimeout → Integer

Deprecated

Deprecated as of PDFreactor 12. Use NetworkSettings::readTimeout instead.

segmentationSettings → SegmentationSettings

This property configures segmentation of the conversion, which helps with very large documents.

signPDF → SignPDF

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 cryptographic filter that is used for signing.

subject → String

Sets the value of the subject field of the PDF document.

title → String

Sets the value of the title field of the PDF document.

urlRewriteSettings → UrlRewriteSettings

Specifies settings for URL rewrites, which will transform URLs into others according to certain rules.

userPassword → String

Deprecated

Deprecated as of PDFreactor 12. Use EncryptionSettings::userPassword instead.

userScripts → Array(Resource)

Adds an user script to the document.

There are two ways to specify the script:

  1. Specifying the script only by an URI.
  2. 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 ResourceSubtypes. Supported subtypes are: ResourceSubtype::JAVASCRIPT_CLASSIC, ResourceSubtype::JAVASCRIPT_IMPORTMAP and ResourceSubtype::JAVASCRIPT_MODULE. Other values are treated as ResourceSubtype::JAVASCRIPT_CLASSIC.

userStyleSheets → Array(Resource)

Adds a user style sheet to the document.

There are two ways to specify the style sheet:

  1. Specifying the style sheet only using an URI.
  2. 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.
validateConformance → Boolean

Enables PDFreactor to validate the generated PDF against the Conformance specified via Configuration.conformance.

Currently only PDF/A and PDF/UA validation is supported.

Please note that validation might take several minutes for larger documents.

viewerPreferences → Array(ViewerPreferences)

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.

xmp → Xmp

Sets custom XMP to be embedded into the PDF document.

If both Xmp::content and Xmp::uri are not set or null no custom XMP is embedded. If XmpPriority is also set to XmpPriority::HIGH automatic generation of required XMP is also suppressed. This may cause output PDFs to not achieve a specified conformance.

xsltMode → Boolean

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.

xsltStyleSheets → Array(Resource)

Adds an XSLT style sheet to the document.

There are two ways to specify the style sheet:

  1. Specifying the style sheet only by an URI.
  2. 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.

Attachment

A type containing attachment data.

data → Base64

The binary content of the attachment. May be null.

description → String

The description of the attachment. If this is not set or null the value of Attachment::name is used.

name → String

The file name associated with the attachment. It is recommended to specify the correct file extension. If this is not set or null the name is derived from Attachment::url.

url → String

If Attachment::data is not set or set to null, the attachment will be retrieved from this URL.

If this is "#" the input document URL is used instead.

BookletMode

A type containing booklet mode data.

rtl → Boolean

Whether or not the reading order of the booklet should be right-to-left.

sheetMargin → String

The sheet margin as CSS margin value, for example "1in", "1cm 1.5cm" or "10mm 20mm 10mm 30mm". null is interpreted as "1cm".

sheetSize → String

The size of the sheet as CSS value, for example "A3", "letter landscape", "15in 20in" or "20cm 30cm". null is interpreted as "A4 landscape".

spacing → String

The horizontal and vertical space between pages on a sheet as CSS value, for example "0.1in". null is interpreted as "1mm".

Bundle

A type representing a bundle of documents.
documents → Array(Document)
An array of documents requests.

Callback

A type containing callback data.

contentType → ContentType

The content type of the payload that is posted.

interval → Integer

The interval in seconds at which to trigger repeating callbacks.

Only applies to CallbackType::PROGRESS.

timeout → Integer

An optional timeout for the callback in milliseconds. A value of zero or negative values are treated as an infinite timeout.

type → CallbackType

The event to trigger the callback.

url → String

The URL to call back.

ColorSpaceSettings

A type containing settings for the potential conversion of CSS colors and images into the target color space.

cmykIccProfile → Resource

Specifies the ICC profile which defines the CMYK color space into or from which CSS colors and images are converted, if enabled.

conversionEnabled → Boolean

Enables the conversion of CSS colors and images to the target color space using the specified CMYK ICC profile or naively if there is none.

targetColorSpace → ColorSpace

Specifies the target color-space of the PDF, i.e. the color space that CSS keyword based colors are converted to.

When ColorSpaceSettings::conversionEnabled is true other CSS colors and images are converted as well.

It is also the color space for PDF/A and PDF/X documents.

Defaults to RGB.

Connection

A type that describes a URL connection attempt of PDFreactor during a conversion.

cacheStatus → String

If a resource cache is used, indicates a status message concerning the cache status of this resource.

cached → Boolean

Whether the response was retrieved from a cache.

connected → Boolean

Whether a URL connection could be established by PDFreactor. If this is false, see Connection::error for details.

contentSize → Integer

The amount of content bytes downloaded or read from this connection.

duration → Integer

The duration in milliseconds how long this connection remained open.

error → String

The error message if the connection could not be established.

method → String

The request method used by the underlying HTTP request (like "GET", "POST", etc.) or null if this is not an HTTP connection or the connection could not be established.

protocol → String

The protocol of the URL connection.

requestContentSize → Integer

The amount of content bytes uploaded or written to this connection.

requestHeaders → Array(KeyValuePair)

The request headers.

Note: If a header has multiple values, there will be one KeyValuePair for each value with the header name as key.

resourceType → ResourceType

The type of resource (style sheet, image, etc.) transferred over this connection.

responseHeaders → Array(KeyValuePair)

The response headers.

Note: If a header has multiple values, there will be one KeyValuePair for each value with the header name as key.

statusCode → Integer

The response code for HTTP connections or 0 for all other connections.

statusMessage → String

The response message for the response code or null if the response code is 0 or the message could not be determined.

timestamp → Integer

The time stamp of this connection.

url → String

The URL.

ConnectionSettings

A type that contains optional settings for the communication between client and PDFreactor Web Service.
cookies → Hash<String, String>
A collection of name-value-pairs representing the cookies that will be added to the HTTP request to the PDFreactor Web Service. This property is empty by default and additional cookies can be added as required. Cookies should only be added in special environments where it is necessary, e.g. when using a load balancer. If the PDFreactor Web Service's response contains any cookies, they will be added to this property, potentially overwriting cookies with the same name.
headers → Hash<String, String>
A collection of name-value-pairs representing the request headers that will be added to the HTTP request to the PDFreactor Web Service. This property is empty by default and additional headers can be added as required. Headers should only be added in special environments where it is necessary.

ContentObserver

A type containing specifications on which content should be observed.

connections → Boolean

Enables observation of URL connections done by PDFreactor.

exceedingContentAgainst → ExceedingContentAgainst

Enables observation of exceeding content either against the page edges, page content areas or containers.

exceedingContentAnalyze → ExceedingContentAnalyze

Enables observation of exceeding content and optionally of boxes.

missingResources → Boolean

Enables observation of resources that could not be loaded.

ContinuousOutput

A type containing continuous output data.

height → Integer

Equivalent to the height of a browser window (view port). For values <1 the entire height of the document is used.

width → Integer

Equivalent to the width of a browser window (view port). Values <1 enable paginated output.

An object containing cookie data.

The domain attribute of the cookie. If null, the cookie is sent to any domain. Specifying no domain is discouraged since cross-domain cookies are not allowed according to the specification, but PDFreactor supports this behavior anyway to remain backwards compatible.

The name of the cookie. This property must be set or the cookie is considered invalid.

The path attribute of the cookie. If null, the cookie is sent to any path.

The secure attribute of the cookie. The default value is false.

The value of the cookie. This property must be set or the cookie is considered invalid.

CssSettings

A type containing settings of how CSS properties are supported.

supportQueryMode → CssPropertySupport

Adjusts the CSS property support behavior.

validationMode → CssPropertySupport

Adjusts the CSS property validation behavior.

DebugSettings

A type containing various options for debugging.

all → Boolean

This is a convenience property that enables the following DebugSettings:

appendLogs → Boolean

Specifies whether the logs will be appended to the resulting PDF.

attachConfiguration → Boolean

Specifies whether the configuration will be attached to the generated PDF.

attachDocuments → Boolean

Specifies whether all debug files belonging to the group "documents" will be attached to the generated PDF. Please see the manual for more information.

attachLogs → Boolean

Specifies whether all debug files belonging to the group "logs" will be attached to the generated PDF. Please see the manual for more information.

attachResources → Boolean

Specifies whether all debug files belonging to the group "resources" will be attached to the generated PDF. Please see the manual for more information.

forceResult → Boolean

Forces PDFreactor to return a result, regardless of any exceptions or errors that may have occurred during the conversion.

If an exception or error occurred during the conversion, its stack trace and the PDFreactor log is written as-is into the result data stream. This means that the resulting document will not be a valid PDF but can be opened with an appropriate text editor to view the log and errors.

Document

A type representing a document request
id → String
The document ID.
name → String
The file name representing the document in the ZIP. If the document is a multi-image, you can use the '#' character in the file name as a placeholder for the page number.

EncryptionSettings

A type containing settings related to PDF encryption.

allowAnnotations → Boolean

Enables or disables the 'annotations' restriction in the PDF document.

The default value is false.

allowAssembly → Boolean

Enables or disables the 'assembly' restriction in the PDF document.

The default value is false.

allowCopy → Boolean

Enables or disables the 'copy' restriction in the PDF document.

The default value is false.

allowDegradedPrinting → Boolean

Enables or disables the 'degraded printing' restriction in the PDF document.

The default value is false.

allowModifyContents → Boolean

Enables or disables the 'modify contents' restriction in the PDF document.

The default value is false.

allowPrinting → Boolean

Enables or disables the 'printing' restriction in the PDF document.

The default value is false.

allowScreenReaders → Boolean

Enables or disables the 'screen readers' restriction in the PDF document.

The default value is false.

ownerPassword → String

Sets the owner password of the PDF document.

type → Encryption

Sets the encryption.

Use one of the Encryption constants to specify the encryption. The default value is Encryption::NONE.

userPassword → String

Sets the user password of the PDF document.

ExceedingContent

A type that describes one instance of content exceeding its page or parent.

bottom → Boolean

Returns whether the content exceeds the page at the bottom.

box → Boolean

Returns whether the exceeding content is a box instead of text or image content.

containerBottom → Integer

Returns the bottom coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.

containerLeft → Integer

Returns the left coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.

containerRight → Integer

Returns the right coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.

containerTop → Integer

Returns the top coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.

description → String

Returns a description of the content. In case of text content, the text is returned. In case of images the URL is returned if available.

exceedingBoxBottom → Integer

Returns the bottom coordinate of the the exceeding box in the page in pixels.

exceedingBoxLeft → Integer

Returns the left coordinate of the the exceeding box in the page in pixels.

exceedingBoxRight → Integer

Returns the right coordinate of the the exceeding box in the page in pixels.

exceedingBoxTop → Integer

Returns the top coordinate of the the exceeding box in the page in pixels.

html → String

Returns the HTML of the box that contains the exceeding content.

left → Boolean

Returns whether the content exceeds the page to the left.

pageBottom → Integer

Returns the bottom coordinate of the the page in pixels.

pageLeft → Integer

Returns the left coordinate of the the page in pixels.

pageNumber → Integer

Returns the number of the page that contains the exceeding content.

pageRight → Integer

Returns the right coordinate of the the page in pixels.

pageTop → Integer

Returns the top coordinate of the the page in pixels.

path → Array(Integer)

Returns an array of integers denoting the indexes of the ancestors of the DOM node corresponding to the box containing the exceeding content, starting from below the root node down to the element itself.

right → Boolean

Returns whether the content exceeds the page to the right.

summary → String

Returns a summary of this exceeding content object.

top → Boolean

Returns whether the content exceeds the page at the top.

Font

A type containing font data.

bold → Boolean

Whether the alias will be labeled bold.

family → String

The alias name for that font.

italic → Boolean

Whether the alias will be labeled italic.

source → String

The source URL of the font (when adding new fonts) or the name of an existing font family (when creating an alias).

HttpCredentials

An object containing HTTP authentication credentials data.

authScheme → HttpAuthScheme

The authentication scheme for which these credentials are intended to be used.

A value of null means any scheme.

host → String

The host for which these credentials are intended to be used.

A value of null means any host.

password → String

The authentication password.

port → Integer

The port for which these credentials are intended to be used.

A value of null or -1 means any port.

protocol → HttpProtocol

The protocol for which these credentials are intended to be used.

A value of null means any protocol.

realm → String

The realm for which these credentials are intended to be used.

A value of null means any realm.

username → String

The authentication user name.

InspectableSettings

A type containing settings related to inspectable documents.

enabled → Boolean

Specifies whether to make the document inspectable.

endPage → Integer

Specifies an optional page number below which the DOM is not inspected.

Page numbers start at 1. The default 0 goes up the last page. Other values are inclusive.

startPage → Integer

Specifies an optional page number below which the DOM is not inspected.

Page numbers start at 1. The default 0 starts at the first page.

JavaScriptRecord

A log record.
level → Integer
The level of the record.
levelName → String
The textual representation of the level.
message → String
The logged message.
sourceLocationInfo → SourceLocationInfo
The logged message.
timestamp → Integer
The timestamp.

JavaScriptSettings

A type containing settings related to JavaScript.

debugIndentation → Integer

Specifies the amount of spaces per indentation level when using JavaScript debugging.

The default value is 0.

Note: This setting does not apply to the GraalJS JavaScipt engine.

debugMode → JavaScriptDebugMode

Specifies the debug mode.

Any other value than the default JavaScriptDebugMode::NONE impacts performance significantly and should not be used in production.

Note: This setting does not apply to the GraalJS JavaScipt engine.

disabled → Boolean

Specifies whether to not process JavaScript.

enabled → Boolean

Deprecated

Deprecated as of PDFreactor 12. Use JavaScriptSettings::disabled instead.

ignoreScriptElements → Boolean

Specifies whether to ignore <script> elements in the document, only executing user scripts.

javaScriptEngine → JavaScriptEngine

Sets the JavaScript engine to be used.

maxQueuedTasks → Integer

Specifies the maximum amount of tasks to be queued before ending JavaScript processing.

Values of 0 or less default to 1,000,000.

maxScriptElements → Integer

Specifies the maximum amount of script elements in the document to process.

Values of 0 or less default to 1,000,000.

maxTasksRepeated → Integer

Specifies the maximum number of times that the same task is allowed to be executed, before ending JavaScript processing.

Values of 0 or less default to 1,000.

Note: This setting does not apply to the GraalJS JavaScipt engine.

maxTasksWithoutDomChange → Integer

Specifies the maximum amount of tasks to be allowed to be queued, while the DOM does not change, before ending JavaScript processing.

Values of 0 or less default to 1,000.

maxVirtualTimeOffset → Integer

Specifies the maximum amount of virtual time in seconds to let pass before ending JavaScript processing.

Values of 0 or less default to 3,600 (1h).

noLayout → Boolean

Specifies whether to process JavaScript without causing document layouts or updates.

This can speed up conversions, but will break a significant amount of functionality and libraries.

noVirtualTime → Boolean

Specifies whether not to use virtual time for JavaScript.

Only use if required for a specific library.

statementLimit → Integer

Specifies the maximum amount of JavaScript statements in thousands, which a single task may execute. This limit allows to break out of infinite loops, but setting it too low may abort the conversion process unnecessarily.

When the limit of statements is exceeded, the conversion is aborted with a TimeoutException.

A value of 0 defaults to 1,000,000 (which equates to 1 billion statements per task).

Values smaller than 0 disable the limit.

Note: This setting does not apply to the GraalJS JavaScipt engine.

timeLapse → Boolean

Specifies whether to fast-forward the virtual time of JavaScript every time it is retrieved.

Only use if required for a specific library.

timeout → Integer

Sets a timeout in seconds for JavaScript processing 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.

KeyValuePair

A type containing a key-value-pair.

key → String

The key.

value → String

The value.

Log

A type representing the log of a conversion.
records → Array(Record)
The log records of the main PDFreactor log.
recordsCss → Array(Record)
The log records of the PDFreactor CSS log.
recordsJavaScript → Array(JavaScriptRecord)
The log records of the PDFreactor JavaScript log.

LogExceedingContent

A type containing data for logging exceeding content.

logExceedingContentAgainst → ExceedingContentAgainst

Enables logging of exceeding content either against the page edges, page content areas or containers.

logExceedingContentAnalyze → ExceedingContentAnalyze

Enables logging of exceeding content and optionally of boxes.

MediaFeatureValue

A type containing media feature data.

mediaFeature → MediaFeature

The media feature.

value → String

The value that is associated with the given media feature.

MergeSettings

A type containing settings related to PDF merging.

disableOverlayAnnotations → Boolean

If set to false, the annotations from the documents to be merged will not be included in the final document.

This is automatically disabled when a Conformance level other than Conformance::PDF is specified

documents → Array(Resource)

This method sets external PDF documents which will be merged with the PDF document generated by the HTML source.

mode → MergeMode

Sets the merge mode.

The following merge methods can be used:

The default value is MergeMode::APPEND.

overlayContentDocument → OverlayContentDocument

Determines whether the converted document or the specified PDF document(s) is the content document for overlaying. The size of each overlaid page is taken from the content document, while the other is fit to that. Also PDF tags, if any, are only taken from the content document.

Use one of the OverlayContentDocument constants to specify the overlay content document. The default value is is OverlayContentDocument::CONVERTED.

overlayFit → OverlayFit

Determines how overlay pages that have different dimensions from the pages they are overlaying should be resized.

Use one of the OverlayFit constants to specify the overlay fit. The default value is is OverlayFit::FILL.

overlayRepeat → OverlayRepeat

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 OverlayRepeat constants to specify the overlay repeat. The default value is OverlayRepeat::NONE.

MissingResource

A type that describes a missing resource.

message → String

The message indicating why the resource could not be found.

resource → String

The resource identifier. Usually a URL string.

type → ResourceType

The type of resource (style sheet, image, etc.).

NetworkSettings

An object containing network settings data.

authenticationCredentials → Array(HttpCredentials)

Enables access to resources that are secured via HTTP authentication.

connectTimeout → Integer

Sets a timeout in milliseconds for connecting to resources, such as HTTP requests to style sheets, images etc. If the connection could not be established until the timeout expires, the request will be aborted and the resource will not be loaded.

A timeout of 0 means that the connection will not time out. A negative value means that no timeout will be set. The default value is 60000 (1min).

cookiePolicy → CookiePolicy
Specifies the cookie handling policy. By default, the policy is browser-like.
cookies → Array(Cookie)

Adds cookies to outgoing HTTP connections.

readTimeout → Integer

Sets a timeout in milliseconds for reading resources, such as HTTP requests to style sheets, images etc. If the download does not start until the timeout expires, the request will be aborted and the resource will not be loaded.

A timeout of 0 means that the download will not time out. A negative value means that no timeout will be set. The default value is 60000 (1min).

requestHeaders → Array(KeyValuePair)

Sets request headers to all outgoing HTTP connections. If the key already exists, the pair is overwritten.

OutputFormat

A type containing output data.

height → Integer

The height of the output in pixels (image formats only). Values <1 will be computed based on the specified width and the aspect ratio of the input document.

multiImage → Boolean

Indicates whether the image output will be written into one separate image per page.

Defaults to true when using PDFreactor::convert

pixelDensity → Integer

The pixel density of the output (image formats only). When neither 'width' nor 'height' is specified this is used to determine the dimensions of the image from the page size. Values <1 default to 96dpi.

See OutputFormat::pixelDensityUnit for the unit of this value (defaults to DPI).

pixelDensityUnit → ResolutionUnit

The unit of the pixel density. Defaults to dpi.

type → OutputType

The output format. See OutputType constants. Defaults to OutputType::PDF.

width → Integer

The with of the output in pixels (image formats only). Values <1 will be computed based on the specified height and the aspect ratio of the input document.

OutputIntent

A type containing data for an output intents.

data → Base64

The profile data.

identifier → OutputIntentDefaultProfile | String

The identifier.

url → String

The profile URL.

PagesPerSheetProperties

A type containing data for pages per sheet properties.

cols → Integer

The number of columns per sheet.

direction → PagesPerSheetDirection

The direction in which the pages are ordered on a sheet.

rows → Integer

The number of rows per sheet.

sheetMargin → String

The sheet margin as CSS margin, for example "1in", "1cm 1.5cm" or "10mm 20mm 10mm 30mm". null is interpreted as "1cm".

sheetSize → String

The sheet size as CSS size, for example "A4", "letter landscape", "15in 20in" or "20cm 30cm". null is interpreted as "A4".

spacing → String

The horizontal and vertical space between pages on a sheet as CSS value, for example "0.1in" or "5mm 2mm". null is interpreted as "1mm".

PdfScriptAction

A type containing PDF script data.

script → String

The script source that should be executed.

triggerEvent → PdfScriptTriggerEvent

The event on which the script is executed. Value is a PdfScriptTriggerEvent constant.

Progress

A type representing the progress of an asynchronous conversion.
callbackUrl → String
If this object was created for a callback, this property indicates the callback's URL.
contentType → String
The content type of the resulting document as a MIME type string. Depends on what OutputType was set in the Configuration. If none was set, the content type defaults to "application/pdf".
conversionName → String
Returns the name of the conversion if it was specified via Configuration.conversionName.
documentId → String
The document ID of the conversion. This ID can be used to poll the progress or retrieve the result.
documentUrl → String
The relative URL to the location where you can download the generated document once it is finished.
documentUrls → Array(String)
The relative URLs to the locations where you can download the generated documents once they are finished.
finished → Boolean
Indicates whether the conversion is finished yet.
log → Log
The log of the conversion.
progress → Integer
The current progress of the conversion. The value is between 0 and 100.
startDate → Date
The date and time when the conversion was started on the server.

QuirksSettings

A type containing quirks settings.

caseSensitiveClassSelectors → QuirksMode

By default in HTML CSS class selectors are case sensitive.

In the default QuirksMode::DETECT mode this behavior is disabled for old HTML doctypes or when there is no doctype.

To enable or disable it independently of the document this property can be set to QuirksMode::STANDARDS or QuirksMode::QUIRKS respectively.

minLineHeightFromContainer → QuirksMode

By default the line-height of text containers, e.g. paragraph elements, is used as the minimum line-height of their lines.

In the default QuirksMode::DETECT mode this behavior is disabled for old HTML doctypes or when there is no doctype.

To enable or disable it independently of the document this property can be set to QuirksMode::STANDARDS or QuirksMode::QUIRKS respectively.

Record

A log record.
level → Integer
The level of the record.
levelName → String
The textual representation of the level.
message → String
The logged message.
timestamp → Integer
The timestamp.

Resource

A type containing data for external resources such as style sheets.

beforeDocumentScripts → Boolean

Use true to cause PDFreactor to run the script before all scripts inside the document and false to run it after.

Only supported for JavaScript-type resources.

content → String

The content of the resource. Only supported for Style Sheet- and Script-type resources.

data → Base64

The binary data of the resource.

password → String

If this Resource describes a PDF document and this document is protected by an user or owner password, use this method to specify the password the document should be opened with.

subtype → ResourceSubtype

The subtype of this resource. This is only relevant for properties that distinguish between multiple subtypes of resources with the same type, such as JavaScriptSettings.

uri → String

The URI of the resource.

Result

A type representing the result of a conversion.
callbackUrl → String
If this object was created for a callback, this property indicates the callback's URL.
connections → Array(Connection)

Provides a log about all URL connections attempted by PDFreactor, including information about HTTP request and result, should the connection be an HTTP or HTTPS connection. Depends on the mode set via Configuration.contentObserver.

contentType → String
The content type of the resulting document as a MIME type string. Depends on what OutputType was set in the Configuration. If none was set, the content type defaults to "application/pdf".
conversionName → String
Returns the name of the conversion if it was specified via Configuration.conversionName.
document → Base64

The resulting PDF or image.

This is not present if only the document's metadata was retrieved.

Alternatively, the input document can be specified directly as Base64.
documentArray → Array(Base64)

The resulting image as a collection of separate images, each representing a single page. This property is only present if the configuration option "multiImage" was set to true.

This is also not present if only the document's metadata was retrieved.

documentId → String
The document ID of the conversion. This ID can be used to poll the progress or retrieve the result.
documentUrl → String
The relative URL to the location where you can download the generated document once it is finished.
documentUrls → Array(String)
The relative URLs to the locations where you can download the generated documents once they are finished.
endDate → Date

The date and time when the conversion was finished on the server.

error → String

Returns the error messages that might have been generated during rendering.

exceedingContents → Array(ExceedingContent)

Provides information about content exceeding its page or parent. Depends on the mode set via "logExceedingContents".

javaScriptExports → String

Returns data that has been exported from document JavaScript via ro.exports if set, null otherwise. If the JavaScript data is not a string, it will be converted to JSON. If the data can't be converted, a generic string representation is used or null if none is available.

keepDocument → Boolean

Indicates whether or not the keepDocument property was set in the Configuration of this conversion. If true, additional requests can be made to retrieve this document.

log → Log

Returns the log messages generated during rendering based on the log level.

missingResources → Array(MissingResource)

Provides information about resources that could not be loaded during the conversion. Depends on the mode set via Configuration.contentObserver.

numberOfPages → Integer

Returns the number of pages of the document after conversion.

numberOfPagesLiteral → Integer

Returns the number of pages of the resulting PDF (including, e.g., merge operations), otherwise it will return the number pages of the laid out input document.

startDate → Date
The date and time when the conversion was started on the server.

SegmentationSettings

A type containing settings for segmenting input documents.

enabled → Boolean

Enables or disables segmentation.

segmentSize → Integer

The preferred size (in number of pages) of the segments into which the conversion will be split.

Valid values range from 10 to 1000. Values of 0 or less default to 1,000.

SignPDF

A type containing data for signing the PDF.

keyAlias → String

The alias of the certificate included in the keystore to be used to sign the PDF.

keyPassword → String

The password for the certificate included in the keystore to be used to sign the PDF.

If none is provided, the keystore password will be used for the certificate.

keystorePassword → String

The password of the keystore.

keystoreType → KeystoreType

The format of the keystore, for example PKCS #12 or JKS. Use one of the KeystoreType constants as value.

keystoreURL → String

The URL to the keystore file.

signingMode → SigningMode

The cryptographic filter mode that is used to sign the PDF, like SELF_SIGNED, VERISIGN_SIGNED or WINCER_SIGNED.

Use one of the SigningMode constants as value.

SourceLocationInfo

An object providing information about the location in a JavaScript that created the log record.
columnEnd → Integer

The end column. A value of zero indicates that the exact column could not be determined.

columnStart → Integer

The start column. A value of zero indicates that the exact column could not be determined.

context → String

The context relative to the source, or null if its the top level context. Can also indicate an element with an appropriate attribute.

lineEnd → Integer

The end line. A value of zero indicates that the exact line could not be determined.

lineStart → Integer

The start line. A value of zero indicates that the exact line could not be determined.

snippet → String

An excerpt of the code that caused the log record.

source → String

The source script file or user script.

UrlRewriteRule

A type containing various options for debugging.

pattern → String

The regular expression pattern which is matched against each URL.

Note that the URLs are always absolute. If they are initially relative in the document or other resources, they are resolved.

substitution → String

If a URL matches the UrlRewriteRule::pattern, it is replaced by this substitution. Since the pattern is a regular expression, the substitution can include group identifiers or back references.

UrlRewriteSettings

A type containing various options for URL rewrites.

rules → Array(UrlRewriteRule)

The rules according to which URLs are rewritten.

Version

A type representing the version of PDFreactor.
build → Integer
The build number.
label → String
The label of the version.
major → Integer
The major version.
micro → Integer
The micro version.
minor → Integer
The minor version.
revision → String
The revision number.
text → String
The version as text.

Xmp

A type containing XMP data.

content → String

XMP, as an XML string, to be embedded into the PDF document.

priority → XmpPriority

Priority of this XMP over XMP generated automatically for the conformance requirements of certain output formats.

uri → String

URI to XMP to be embedded into the PDF document, if Xmp::content is not set or null.

Constants

PDFreactor::AddressType

An enum containing IP address types.

Link-local addresses or auto-IPs.

LOCAL

Localhost addresses, including "localhost" or "0.0.0.0".

PRIVATE

Private network addresses.

PUBLIC

Public internet addresses.

PDFreactor::CallbackType

An enum containing callback type constants.

FINISH

This callback is called when the conversion is finished.

PROGRESS

This callback is called regularly to inform on the progress of the conversion.

START

This callback is called when the conversion is started.

PDFreactor::Cleanup

An enum containing cleanup constants.

CYBERNEKO

Indicates that the CyberNeko HTML parser will be used to perform a cleanup when loading a non-well-formed document.

JTIDY

Indicates that JTidy will be used to perform a cleanup when loading a non-well-formed document.

NONE

Indicates that no cleanup will be performed when loading a document. If the loaded document is not well-formed, an exception will be thrown.

TAGSOUP

Indicates that tagsoup will be used to perform a cleanup when loading a non-well-formed document.

PDFreactor::ColorSpace

An enum containing color space constants.

CMYK

The color space CMYK.

RGB

The color space RGB.

PDFreactor::Conformance

An enum containing conformance constants.

PDF

PDF with no additional restrictions (default)

PDFA1A

PDF/A-1a (ISO 19005-1:2005 Level A)

PDFA1A_PDFUA1

PDF/A-1a + PDF/UA-1 (ISO 19005-1:2005 Level A + ISO 14289-1:2014)

PDFA1B

PDF/A-1b (ISO 19005-1:2005 Level B)

PDFA2A

PDF/A-2a (ISO 19005-2:2011 Level A)

PDFA2A_PDFUA1

PDF/A-2a + PDF/UA-1 (ISO 19005-2:2011 Level A + ISO 14289-1:2014)

PDFA2B

PDF/A-2b (ISO 19005-2:2011 Level B)

PDFA2U

PDF/A-2u (ISO 19005-2:2011 Level U)

PDFA3A

PDF/A-3a (ISO 19005-3:2012 Level A)

PDFA3A_PDFUA1

PDF/A-3a + PDF/UA-1 (ISO 19005-3:2012 Level A + ISO 14289-1:2014)

PDFA3B

PDF/A-3b (ISO 19005-3:2012 Level B)

PDFA3U

PDF/A-3u (ISO 19005-3:2012 Level U)

PDFUA1

PDF/UA-1 (ISO 14289-1:2014)

PDFX1A_2001

PDF/X-1a:2001 (ISO 15930-1:2001)

PDFX1A_2003

PDF/X-1a:2003 (ISO 15930-4:2003)

PDFX3_2002

PDF/X-3:2002 (ISO 15930-3:2002)

PDFX3_2003

PDF/X-3:2003 (ISO 15930-6:2003)

PDFX4

PDF/X-4 (ISO 15930-7:2008)

PDFX4P

PDF/X-4p (ISO 15930-7:2008)

PDFreactor::ConnectionRuleAction

An enum containing security rule action constants.

ALLOW

Allows connections to resources matching the rule.

DENY

Denies connections to resources matching the rule.

PDFreactor::ContentType

An enum containing content type constants.

BINARY

Content type BINARY, corresponds with "application/octet-stream" MIME type.

BMP

Content type BMP, corresponds with "image/bmp" MIME type.

GIF

Content type GIF, corresponds with "image/gif" MIME type.

HTML

Content type HTML, corresponds with "text/html" MIME type.

JPEG

Content type JPEG, corresponds with "image/jpeg" MIME type.

JSON

Content type JSON, corresponds with "application/json" MIME type.

NONE

Content type NONE, i.e. no content.

PDF

Content type PDF, corresponds with "application/pdf" MIME type.

PNG

Content type PNG, corresponds with "image/png" MIME type.

TEXT

Content type TEXT, corresponds with "text/plain" MIME type.

TIFF

Content type TIFF, corresponds with "image/tiff" MIME type.

XML

Content type XML, corresponds with "application/xml" MIME type.

PDFreactor::CookiePolicy

An enum containing cookie policy constants.

DISABLED

Disables cookie handling entirely. Cookies specified in the API are still sent, but server cookies are rejected.

RELAXED

A standard-compliant cookie policy that ignores date issues. This is the default value.

STRICT

A strict standard-compliant cookie policy.

PDFreactor::CssPropertySupport

An enum containing CSS property support mode constants.

ALL

Indicates that all style declarations are considered valid disregarding the possibility of improper rendering.

Valid values may be overwritten by invalid style declarations.

HTML

Indicates that all values set in style declarations will be validated as long as PDFreactor supports the corresponding property.

Style declarations for properties not supported by PDFreactor are taken as invalid.

HTML_THIRD_PARTY

Indicates that all values set in style declarations will be validated as long as PDFreactor supports the corresponding property.

Style declarations for properties not supported by PDFreactor but by third party products are taken as valid.

HTML_THIRD_PARTY_LENIENT

Indicates that all values set in style declarations will be taken as valid if a third party product supports the corresponding property.

Style declarations for properties not supported by any third party product but supported by PDFreactor will be validated.

PDFreactor::Doctype

An enum containing document type constants.

AUTODETECT

Indicates that the document type will be detected automatically. When the document has a file extension, it is used to determine whether the document is Doctype::HTML5 or Doctype::XHTML. If there is no file extension or it is unknown, then the document content itself is searched for an XML declaration, a doctype preamble and the root element.

HTML5

Indicates that the document type will be set to HTML5. The HTML default style sheet is used and the document is loaded regarding style elements, style attributes and link stylesheets.

XHTML

Indicates that the document type will be set to XHTML. The HTML default style sheet is used and the document is loaded regarding style elements, style attributes and link stylesheets.

XML

Indicates that the document type will be set to generic XML. No default style sheet is used and the document is loaded as is without regards to style elements or attributes.

PDFreactor::Encryption

An enum containing encryption constants.

AES_128

Indicates that the document will be encrypted using AES 128 bit encryption.

AES_256

Indicates that the document will be encrypted using AES 256 bit encryption.

NONE

Indicates that the document will not be encrypted. If encryption is disabled then no user password and no owner password can be used.

RC4_128

Indicates that the document will be encrypted using RC4 128 bit encryption.

RC4_40

Indicates that the document will be encrypted using RC4 40 bit encryption.

TYPE_128

Deprecated as of PDFreactor 12. Use Encryption::RC4_128 instead.

TYPE_40

Deprecated as of PDFreactor 12. Use Encryption::RC4_40 instead.

PDFreactor::ErrorPolicy

An enum containing error policies.

CONFORMANCE_VALIDATION_UNAVAILABLE

Whether an exception should be thrown when the PDF's conformance was not validated even though Configuration.validateConformance was enabled. Now exceptions will be thrown if the validation module is not available or the conformance format is not fully supported for validation.

Use this policy only if you exclusively convert documents where validation is supported and strictly required.

IGNORE_INVALID_MERGE_DOCUMENTS_EXCEPTION

Whether exceptions occurring when trying to merge invalid documents (e.g. encrypted documents for which no owner password or an invalid password was supplied) should be ignored.

Use this policy if the conversion should proceed even if one or more documents that should be merged are invalid. They will be omitted from the final PDF.

LICENSE

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.

MISSING_RESOURCE

Whether an exception should be thrown when resources could not be loaded.

UNCAUGHT_JAVASCRIPT_EXCEPTION

Whether an exception should be thrown when there are uncaught exceptions in the input document JavaScript, including syntax error.

WARN_EVENT

Whether an exception should be thrown when an event of level LogLevel::WARN is logged.

PDFreactor::ExceedingContentAgainst

An enum containing constants for logging exceeding content against.

NONE

Do not log exceeding content.

PAGE_BORDERS

Log content exceeding the edges of its page.

PAGE_CONTENT

Log content exceeding its page content area (overlaps the page margin).

PARENT

Log content exceeding its container.

PDFreactor::ExceedingContentAnalyze

An enum containing constants for analyzing exceeding content.

CONTENT

Log exceeding content.

CONTENT_AND_BOXES

Log exceeding content and all boxes.

CONTENT_AND_STATIC_BOXES

Log exceeding content and boxes without absolute positioning.

NONE

Do not log exceeding content.

PDFreactor::HttpAuthScheme

An enum containing HTTP authentication scheme constants.

ANY

This constant indicates that the credentials are to be used for any authentication scheme. This is the default value.

BASIC

BASIC authentication.

DIGEST

DIGEST authentication.

KERBEROS

Kerberos authentication.

NTLM

Windows NTLM authentication.

SPNEGO

Simple and Protected GSSAPI Negotiation Mechanism.

PDFreactor::HttpProtocol

An enum containing HTTP protocol constants.

ANY

This constant indicates that the credentials are to be used for any HTTP protocol.

HTTP

HTTP only.

HTTPS

HTTPS only.

PDFreactor::HttpsMode

Deprecated as of PDFreactor 12. Use SecuritySettings::trustAllConnectionCertificates instead.

LENIENT

Indicates lenient HTTPS behavior. This means that many certificate issues are ignored.

STRICT

Indicates strict HTTPS behavior. This matches the default behavior of Java.

PDFreactor::JavaScriptDebugMode

An enum containing JavaScript debug mode constants.

EXCEPTIONS

Indicates that all exceptions thrown during JavaScript processing are logged in addition to the effects of POSITIONS.

FUNCTIONS

Indicates that all JavaScript functions entered or exited are logged in addition to the effects of POSITIONS and EXCEPTIONS.

LINES

Indicates that every line of executed JavaScript is logged in addition to the effects of POSITIONS, EXCEPTIONS and FUNCTIONS.

NONE

Indicates that debugging is disabled.

POSITIONS

Indicates that the filenames and line numbers that caused output (e.g. via console.log) are logged.

PDFreactor::JavaScriptEngine

An enum containing JavaScript engines.

GRAALJS

GraalVM JavaScript engine

RHINO

Rhino JavaScript engine

PDFreactor::KeystoreType

An enum containing keystore type constants.

JKS

Keystore type "jks".

PKCS12

Keystore type "pkcs12".

PDFreactor::LogLevel

An enum containing log level constants.

DEBUG

Indicates that debug, info, warn and fatal log events will be logged.

ERROR

Indicates that only error log events will be logged.

FATAL

Deprecated

Deprecated as of PDFreactor 12. Use LogLevel::ERROR instead.

INFO

Indicates that info, warn and fatal log events will be logged.

NONE

Indicates that no log events will be logged.

PERFORMANCE

Deprecated

Deprecated as of PDFreactor 12. Use LogLevel::TRACE instead.

TRACE

Indicates that all log events will be logged.

WARN

Indicates that warn and fatal log events will be logged.

PDFreactor::MediaFeature

An enum containing media feature constants.

ANY_HOVER

CSS Media Feature (Media Queries Level 4) describing whether any available input mechanism allows the user to hover over elements.

The default value is "none".

ANY_POINTER

CSS Media Feature (Media Queries Level 4) describing whether any available input mechanism is a pointing device, and if so, how accurate is it.

The default value is "none".

ASPECT_RATIO

CSS 3 Media Feature describing the aspect ratio of the page content.

By default, this value is computed using the values of MediaFeature::WIDTH and MediaFeature::HEIGHT. Setting a specific value does override the computed value.

COLOR

CSS 3 Media Feature describing the number of bits per color component.

Default value is 8, except if the output is forced to be grayscale, in which case it is 0.

COLOR_GAMUT

CSS Media Feature (Media Queries Level 4) describing the approximate range of colors that are supported by the UA and output device.

The default value is "srgb".

COLOR_INDEX

CSS 3 Media Feature describing the number of entries in the color lookup table.

Default value is 0, except if the output format is "gif" in which case it is 256.

DEVICE_ASPECT_RATIO

CSS 3 Media Feature describing the aspect ratio of the page.

By default, this value is computed using the values of MediaFeature::DEVICE_WIDTH and MediaFeature::DEVICE_HEIGHT. Setting a specific value does override the computed value.

DEVICE_HEIGHT

CSS 3 Media Feature describing the height of the page.

The default height is that of a DIN A4 page (297mm).

DEVICE_WIDTH

CSS 3 Media Feature describing the width of the page.

The default width is that of a DIN A4 page (210mm).

DISPLAY_MODE

CSS Media Feature (Media Queries Level 5) representing how a web application is being presented within the context of an OS.

The default value is "fullscreen".

DYNAMIC_RANGE

CSS Media Feature (Media Queries Level 5) representing the combination of max brightness, color depth, and contrast ratio that are supported by the user agent and output device.

The default value is "standard".

ENVIRONMENT_BLENDING

CSS Media Feature (Media Queries Level 5) that is used to query the characteristics of the user's display so the author can adjust the style of the document.

The default value is "opaque".

FORCED_COLORS

CSS Media Feature (Media Queries Level 5) indicates whether the user-agent enforces a limited color palette.

The default value is "none".

GRID

CSS 3 Media Feature defining whether the output is grid-based.

Default value 0, as PDFs are not grid-based.

HEIGHT

CSS 3 Media Feature height of page content.

The default height is that of a DIN A4 page with 2cm margin (257mm).

HORIZONTAL_VIEWPORT_SEGMENTS

CSS Media Feature (Media Queries Level 5) that describes the number of logical segments of the viewport in the horizontal direction.

The default value is "1".

HOVER

CSS Media Feature (Media Queries Level 4) describing whether the primary input mechanism allows the user to hover over elements.

The default value is "none".

INVERTED_COLORS

CSS Media Feature (Media Queries Level 5) indicating whether the content is displayed normally, or whether colors have been inverted.

The default value is "none".

MONOCHROME

CSS 3 Media Feature describing the number of bits per pixel in a monochrome frame buffer.

Default value is 0, if the output format is not monochrome.

NAV_CONTROLS

CSS Media Feature (Media Queries Level 5) allowing authors to know whether the user agent is providing obviously discoverable navigation controls as part of its user interface.

The default value is "none".

ORIENTATION

CSS 3 Media Feature describing the page orientation.

By default, this value is computed using the values of MediaFeature::WIDTH and MediaFeature::HEIGHT. Setting a specific value does override the computed value.

Valid values are "portrait" or "landscape".

OVERFLOW_BLOCK

CSS Media Feature (Media Queries Level 4) describing the behavior of the device when content overflows the initial containing block in the block axis.

The default value is "page", except if an image output was set to continuous, in which case it is "none".

OVERFLOW_INLINE

CSS Media Feature (Media Queries Level 4) describing the behavior of the device when content overflows the initial containing block in the inline axis.

The default value is "none".

POINTER

CSS Media Feature (Media Queries Level 4) describing whether the primary input mechanism is a pointing device, and if so, how accurate is it.

The default value is "none".

PREFERS_COLOR_SCHEME

CSS Media Feature (Media Queries Level 5) reflecting the user's desire that the page use a light or dark color theme.

The default value is "light".

PREFERS_CONSTRAST

CSS Media Feature (Media Queries Level 5) used to detect if the user has requested more or less contrast in the page.

The default value is "no-preference".

PREFERS_REDUCED_DATA

CSS Media Feature (Media Queries Level 5) used to detect if the user has a preference for being served alternate content that uses less data for the page to be rendered.

The default value is "no-preference".

PREFERS_REDUCED_MOTION

CSS Media Feature (Media Queries Level 5) used to detect if the user has requested the system minimize the amount of animation or motion it uses.

The default value is "reduce".

PREFERS_REDUCED_TRANSPARENCY

CSS Media Feature (Media Queries Level 5) used to detect if the user has requested the system minimize the amount of transparent or translucent layer effects it uses.

The default value is "no-preference".

RESOLUTION

CSS 3 Media Feature describing the resolution of the output device.

This also defines the value of the window.devicePixelRatio property available from JavaScript.

Default value is 300dpi.

SCAN

CSS Media Feature (Media Queries Level 4) describing the scanning process of some output devices.

The default value is "progressive".

SCRIPTING

CSS Media Feature (Media Queries Level 5) used to query whether scripting languages, such as JavaScript, are supported on the current document.

The default value is "initial-only" if JavaScript has been enabled or "none" otherwise.

UPDATE

CSS Media Feature (Media Queries Level 5) used to query the ability of the output device to modify the appearance of content once it has been rendered.

The default value is "none".

VERTICAL_VIEWPORT_SEGMENTS

CSS Media Feature (Media Queries Level 5) that describes the number of logical segments of the viewport in the vertical direction.

The default value is "1".

VIDEO_COLOR_GAMUT

CSS Media Feature (Media Queries Level 5) describing the approximate range of colors that are supported by the UA and output device's video plane.

The default value is "srgb".

VIDEO_DYNAMIC_RANGE

CSS Media Feature (Media Queries Level 5) representing the combination of max brightness, color depth, and contrast ratio that are supported by the UA and output device's video plane.

The default value is "standard".

WIDTH

CSS 3 Media Feature width of page content.

The default width is that of a DIN A4 page with 2cm margin (170mm).

PDFreactor::MergeMode

An enum containing merge mode constants.

APPEND

Default merge mode: Append converted document to existing PDF.

ARRANGE

Advanced merge mode: Allows to insert specific pages from existing PDFs into the converted document.

This is done via a special syntax of Configuration.pageOrder.

OVERLAY

Alternate merge mode (overlay): Adding converted document above the existing PDF.

OVERLAY_BELOW

Alternate merge mode (overlay): Adding converted document below the existing PDF.

PREPEND

Alternate merge mode: Prepend converted document to existing PDF.

PDFreactor::OutputIntentDefaultProfile

An enum containing default profiles for output intents.

FOGRA39

"Coated FOGRA39" output intent default profile.

GRACOL

"Coated GRACoL 2006" output intent default profile.

IFRA

"ISO News print 26% (IFRA)" output intent default profile.

JAPAN

"Japan Color 2001 Coated" output intent default profile.

JAPAN_NEWSPAPER

"Japan Color 2001 Newspaper" output intent default profile.

JAPAN_UNCOATED

"Japan Color 2001 Uncoated" output intent default profile.

JAPAN_WEB

"Japan Web Coated (Ad)" output intent default profile.

SWOP

"US Web Coated (SWOP) v2" output intent default profile.

SWOP_3

"Web Coated SWOP 2006 Grade 3 Paper" output intent default profile.

PDFreactor::OutputType

An enum containing output format constants.

BMP

BMP output format.

GIF

GIF output format.

GIF_DITHERED

JPEG output format, with dithering applied.

JPEG

JPEG output format.

PDF

PDF output format.

PNG

PNG output format.

PNG_AI

Deprecated

Deprecated as of PDFreactor 11. Use OutputType::PNG instead.

PNG_TRANSPARENT

Transparent PNG output format.

PNG_TRANSPARENT_AI

Deprecated

Deprecated as of PDFreactor 11. Use OutputType::PNG_TRANSPARENT instead.

TIFF_CCITT_1D

Monochrome CCITT 1D/RLE compressed TIFF output format.

TIFF_CCITT_1D_DITHERED

Monochrome CCITT 1D/RLE compressed TIFF output format, with dithering applied.

TIFF_CCITT_GROUP_3

Monochrome CCITT Group 3/T.4 compressed TIFF output format.

TIFF_CCITT_GROUP_3_DITHERED

Monochrome CCITT Group 3/T.4 compressed TIFF output format, with dithering applied.

TIFF_CCITT_GROUP_4

Monochrome CCITT Group 4/T.6 compressed TIFF output format.

TIFF_CCITT_GROUP_4_DITHERED

Monochrome CCITT Group 4/T.6 compressed TIFF output format, with dithering applied.

TIFF_LZW

LZW compressed TIFF output format.

TIFF_PACKBITS

PackBits compressed TIFF output format.

TIFF_UNCOMPRESSED

Uncompressed TIFF output format.

PDFreactor::OverlayContentDocument

An enum containing constants that determines whether the converted document or the specified PDF document(s) is the content document for overlaying.

CONVERTED

The converted HTML document will be the content document.

PDF

The PDF document(s) indicated in the MergeSettings "documents", appended to each other if there are multiple ones, will be the content document.

PDFreactor::OverlayFit

An enum containing data to configure how overlay pages that have different dimensions from the pages they are overlaying should be resized.

CONTAIN

The page keeps its aspect ratio, but is resized to fit within the given dimension.

COVER

The page keeps its aspect ratio and fills the given dimension. It will be clipped to fit.

FILL

The default. The page is resized to fill the given dimension. If necessary, the page will be stretched or squished to fit.

NONE

The page is not resized. If necessary it will be clipped to fit.

PDFreactor::OverlayRepeat

An enum containing data for repeating overlays.

ALL_PAGES

All pages of the shorter document are repeated, to overlay all pages of the longer document.

LAST_PAGE

Last page of the shorter document is repeated, to overlay all pages of the longer document.

NONE

No pages of the shorter document are repeated, leaving some pages of the longer document without overlay.

TRIM

The resulting PDF is trimmed to the number of pages of the shorter document.

PDFreactor::PageOrder

An enum containing pre-defined page orders.

BOOKLET

Page order mode to arrange all pages in booklet order. To be used with PagesPerSheetDirection::RIGHT_DOWN.

BOOKLET_RTL

Page order mode to arrange all pages in right-to-left booklet order. To be used with PagesPerSheetDirection::RIGHT_DOWN.

EVEN

Page order mode to keep even pages only.

ODD

Page order mode to keep odd pages only.

REVERSE

Page order mode to reverse the page order.

PDFreactor::PagesPerSheetDirection

An enum containing constants for pages per sheet directions.

DOWN_LEFT

Arranges the pages on a sheet from top to bottom and right to left.

DOWN_RIGHT

Arranges the pages on a sheet from top to bottom and left to right.

LEFT_DOWN

Arranges the pages on a sheet from right to left and top to bottom.

LEFT_UP

Arranges the pages on a sheet from right to left and bottom to top.

RIGHT_DOWN

Arranges the pages on a sheet from left to right and top to bottom.

RIGHT_UP

Arranges the pages on a sheet from left to right and bottom to top.

UP_LEFT

Arranges the pages on a sheet from bottom to top and right to left.

UP_RIGHT

Arranges the pages on a sheet from bottom to top and left to right.

PDFreactor::PdfScriptTriggerEvent

An enum containing trigger events for PDF scripts.

AFTER_PRINT

This event is triggered after the PDF has been printed by the viewer application.

AFTER_SAVE

This event is triggered after the PDF has been saved by the viewer application.

BEFORE_PRINT

This event is triggered before the PDF is printed by the viewer application.

BEFORE_SAVE

This event is triggered before the PDF is saved by the viewer application.

CLOSE

This event is triggered when the PDF is closed by the viewer application.

OPEN

This event is triggered when the PDF is opened in the viewer application.

PDFreactor::ProcessingPreferences

An enum containing constants for processing preferences.

SAVE_MEMORY_IMAGES

Processing preferences flag for the memory saving mode for images.

PDFreactor::QuirksMode

An enum containing modes for Quirks.

DETECT

Doctype dependent behavior.

QUIRKS

Forced quirks behavior.

STANDARDS

Forced no-quirks behavior.

PDFreactor::ResolutionUnit

An enum containing resolution units.

DPCM

Dots per inch. The default 1dppx/96dpi in this unit is about 38.

DPI

Dots per Inch. The default 1dppx/96dpi in this unit is 96.

DPPX

Dots per 'px' unit. The default 1dppx/96dpi in this unit is 1.

TDPCM

Thousand dots per centimeter. The default 1dppx/96dpi in this unit is about 37795.

TDPI

Thousand dots per inch. The default 1dppx/96dpi in this unit is 96000.

TDPPX

Thousand dots per 'px' unit. The default 1dppx/96dpi in this unit is 1000.

PDFreactor::ResourceSubtype

An enum containing resource sub type constants.

JAVASCRIPT_CLASSIC

Indicates a "classic" (non-module) JavaScript. Used for resources of type ResourceType::SCRIPT.

JAVASCRIPT_IMPORTMAP

Indicates a JavaScript import map. Used for resources of type ResourceType::SCRIPT.

JAVASCRIPT_MODULE

Indicates a JavaScript module. Used for resources of type ResourceType::SCRIPT.

PDFreactor::ResourceType

Indicates the type of resource.

ATTACHMENT

An attachment.

DOCUMENT
The main HTML or XML document.
FONT

A font.

ICC_PROFILE

An ICC profile.

IFRAME

An iframe.

IMAGE

An image.

LICENSEKEY

The license key.

MERGE_DOCUMENT

A merge document.

OBJECT

An embedded object.

RUNNING_DOCUMENT

A running document.

SCRIPT

A script.

STYLESHEET

A style sheet.

UNKNOWN

An unknown resource type.

XHR
An XMLHttpRequest.

PDFreactor::SigningMode

An enum containing the cryptographic filter type that is used for signing.

SELF_SIGNED

The self signed filter: PDFreactor creates a signature with the adbe.x509.rsa_sha1 (PKCS#1) filter type.

VERISIGN_SIGNED

The VeriSign filter. PDFreactor creates a signature with VeriSign filter type.

WINCER_SIGNED

The Windows Certificate Security: PDFreactor creates a signature with the adbe.pkcs7.sha1 (PKCS#7) filter type.

PDFreactor::ViewerPreferences

An enum containing constants for viewer preferences.

CENTER_WINDOW

Position the document's window in the center of the screen.

DIRECTION_L2R

Position pages in ascending order from left to right.

DIRECTION_R2L

Position pages in ascending order from right to left.

DISPLAY_DOC_TITLE

Display the document's title in the top bar.

DUPLEX_FLIP_LONG_EDGE

Print dialog default setting: duplex (long edge).

DUPLEX_FLIP_SHORT_EDGE

Print dialog default setting: duplex (short edge).

DUPLEX_SIMPLEX

Print dialog default setting: simplex.

FIT_WINDOW

Resize the document's window to fit the size of the first displayed page.

HIDE_MENUBAR

Hide the viewer application's menu bar when the document is active.

HIDE_TOOLBAR

Hide the viewer application's tool bars when the document is active.

HIDE_WINDOW_UI

Hide user interface elements in the document's window.

NON_FULLSCREEN_PAGE_MODE_USE_NONE

Show no panel on exiting full-screen mode. Has to be combined with ViewerPreferences::PAGE_MODE_FULLSCREEN.

NON_FULLSCREEN_PAGE_MODE_USE_OC

Show optional content group panel on exiting full-screen mode. Has to be combined with ViewerPreferences::PAGE_MODE_FULLSCREEN.

NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES

Show bookmarks panel on exiting full-screen mode. Has to be combined with ViewerPreferences::PAGE_MODE_FULLSCREEN.

NON_FULLSCREEN_PAGE_MODE_USE_THUMBS

Show thumbnail images panel on exiting full-screen mode. Has to be combined with ViewerPreferences::PAGE_MODE_FULLSCREEN.

PAGE_LAYOUT_ONE_COLUMN

Display the pages in one column.

PAGE_LAYOUT_SINGLE_PAGE

Display one page at a time (default).

PAGE_LAYOUT_TWO_COLUMN_LEFT

Display the pages in two columns, with odd numbered pages on the left.

PAGE_LAYOUT_TWO_COLUMN_RIGHT

Display the pages in two columns, with odd numbered pages on the right.

PAGE_LAYOUT_TWO_PAGE_LEFT

Display two pages at a time, with odd numbered pages on the left.

PAGE_LAYOUT_TWO_PAGE_RIGHT

Display two pages at a time, with odd numbered pages on the right.

PAGE_MODE_FULLSCREEN

Switch to fullscreen mode on startup.

PAGE_MODE_USE_ATTACHMENTS

Show attachments panel on startup.

PAGE_MODE_USE_NONE

Show no panel on startup.

PAGE_MODE_USE_OC

Show optional content group panel on startup.

PAGE_MODE_USE_OUTLINES

Show bookmarks panel on startup.

PAGE_MODE_USE_THUMBS

Show thumbnail images panel on startup.

PICKTRAYBYPDFSIZE_FALSE

Print dialog default setting: do not pick tray by PDF size.

PICKTRAYBYPDFSIZE_TRUE

Print dialog default setting: pick tray by PDF size.

PRINTSCALING_APPDEFAULT

Print dialog default setting: set scaling to application default value.

PRINTSCALING_NONE

Print dialog default setting: disabled scaling.

PDFreactor::XmpPriority

An enum containing the priority for XMP.

HIGH

Embed XMP ignoring requirements of the output format.

This may cause output PDFs to not achieve a specified conformance.

LOW

Embed XMP if the output format does not have XMP requirements.

NONE

Do not embed XMP.

Errors

PDFreactor::PDFreactorWebserviceError < PDFreactor::StandardError

Possible Causes

  • This type of exception is thrown by the PDFreactor Web Service client. It has several sub classes, all indicating different issues. To react to specific problems, it is recommended to catch appropriate sub class exceptions.

PDFreactor::ClientError < PDFreactor::PDFreactorWebserviceError

Possible Causes

  • This type of exception is produced by the client and indicates that a connection to the PDFreactor Web Service could not be established. Exceptions of this class do not necessarily indicate a problem with the PDFreactor Web Service, only that it could not be reached. This could have various reasons, including a non-functioning PDFreactor Web Service, a blocking firewall or an incorrectly configured service URL.

PDFreactor::ServerError < PDFreactor::PDFreactorWebserviceError

Possible Causes

  • This type of exception is produced by the PDFreactor Web Service and indicates that the conversion could not be processed for some reason. Exceptions of this class mean that the PDFreactor Web Service is running. Please note that the client requires the 'X-RO-Error-ID' HTTP header to be present to convert the exception in the appropriate type. If that header is missing, exceptions will have this generic type instead.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::AsyncUnavailableError < PDFreactor::ServerError

Possible Causes

  • Asynchronous conversions are not available in this PDFreactor Web Service.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::BadRequestError < PDFreactor::ServerError

Possible Causes

  • The page number you specified is either below 0 or exceeds the document's total number of pages.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::ConversionAbortedError < PDFreactor::ServerError

Possible Causes

  • The supplied configuration is valid, however the conversion could not be completed for some reason. See the error message for details.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::ConversionFailureError < PDFreactor::ServerError

Possible Causes

  • The configuration could not be processed and should be re-checked.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::DocumentNotFoundError < PDFreactor::ServerError

Possible Causes

  • Conversion does not exist.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::InvalidClientError < PDFreactor::ServerError

Possible Causes

  • The version of the client that was used is outdated and no longer supported. This is only available for the PDFreactor REST clients.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::InvalidConfigurationError < PDFreactor::ServerError

Possible Causes

  • The supplied configuration was not valid for some reason. See the error message for details.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::NoConfigurationError < PDFreactor::ServerError

Possible Causes

  • No configuration was supplied to the operation.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::NoInputDocumentError < PDFreactor::ServerError

Possible Causes

  • No input document was specified in the configuration.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::NotAcceptableError < PDFreactor::ServerError

Possible Causes

  • The server could not produce a result with a media type that matches the client's request. The configuration or Accept header should be adjusted accordingly.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::ServiceUnavailableError < PDFreactor::ServerError

Possible Causes

  • The PDFreactor Web Service is running and reachable, but not in a state to perform the requested operation.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::UnauthorizedError < PDFreactor::ServerError

Possible Causes

  • The client failed an authorization check, e.g. because a supplied API key was invalid.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::UnprocessableConfigurationError < PDFreactor::ServerError

Possible Causes

  • The supplied configuration was accepted by PDFreactor but could not be converted for some reason. See the error message for details.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::UnprocessableInputError < PDFreactor::ServerError

Possible Causes

  • The supplied input data was accepted by PDFreactur but could not be processed for some reason. See the error message for details.

Additional Properties

result → Result
The partial result of the conversion.

PDFreactor::InvalidServiceError < PDFreactor::ClientError

Possible Causes

  • A response was received but it could not be identified as a response from the PDFreactor Web Service.

PDFreactor::UnreachableServiceError < PDFreactor::ClientError

Possible Causes

  • The PDFreactor Web Service could not be reached.