| | |
- ExceedingContent
- PDFreactor
- ROClient
- confObj
class ExceedingContent |
| |
Object that describes one instance of content exceeding its page or parent. |
| |
Methods defined here:
- __init__(self)
- getContainerBottom(self)
- Returns the bottom coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.
- getContainerLeft(self)
- Returns the left coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.
- getContainerRight(self)
- Returns the right coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.
- getContainerTop(self)
- Returns the top coordinate of the the container box in the page in pixels. Depending on the settings this box may be the page.
- getDescription(self)
- 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.
- getExceedingBoxBottom(self)
- Returns the bottom coordinate of the the exceeding box in the page in pixels.
- getExceedingBoxLeft(self)
- Returns the left coordinate of the the exceeding box in the page in pixels.
- getExceedingBoxRight(self)
- Returns the right coordinate of the the exceeding box in the page in pixels.
- getExceedingBoxTop(self)
- Returns the top coordinate of the the exceeding box in the page in pixels.
- getHtml(self)
- Returns the HTML of the box that contains the exceeding content.
- getPageBottom(self)
- Returns the bottom coordinate of the the page in pixels.
- getPageLeft(self)
- Returns the left coordinate of the the page in pixels.
- getPageNumber(self)
- Returns the number of the page that contains the exceeding content.
- getPageRight(self)
- Returns the right coordinate of the the page in pixels.
- getPageTop(self)
- Returns the top coordinate of the the page in pixels.
- getSummary(self)
- Returns a summary of this exceeding content object.
- isBottom(self)
- Returns whether the content exceeds the page at the bottom.
- isBox(self)
- Returns whether the exceeding content is a box instead of text or image content.
- isLeft(self)
- Returns whether the content exceeds the page to the left.
- isRight(self)
- Returns whether the content exceeds the page to the right.
- isTop(self)
- Returns whether the content exceeds the page at the top.
|
class PDFreactor |
| | |
Methods defined here:
- __init__(self, host='localhost', port=9423, debug=False)
- Constructor
- addAttachment(self, data, url, name, description)
- Adds a file attachment to PDF document.
param string data The base64encoded binary content of the attachment. May be None.
param string url If data is None, the attachment will be retrieved from this URL.
If this is "#" the input document URL is used instead.
param string name The file name associated with the attachment. It is recommended to specify
the correct file extension. If this is None the name is derived from the URL.
param string description The description of the attachment. If this is None the name is used.
- addCustomDocumentProperty(self, name, value)
- Adds a custom property to the PDF document. An existing
property of the same name will be replaced.
param string name The name of the property.
param string value The value of the property.
- addFont(self, source, family, bold, italic)
- Loads a font from a URL which can be used via the CSS property "font-family".
param source The URL to load the font from.
param family The font family name the loaded font will be labeled as.
param bold Whether the font will be labeled bold.
param italic Whether the font will be labeled italic.
- addFontAlias(self, source, family, bold, italic)
- Registers an alias font family for an existing font.
This function is limited to fonts loaded automatically from system folders.
param source The name of an existing font family.
param family The alias name for that font.
param bold Whether the alias will be labeled bold.
param italic Whether the alias will be labeled italic.
- addFontDirectory(self, fontDirectory)
- Registers an additional font directory to load fonts from.
param fontDirectory The path of the font directory.
- addUserScript(self, content, URI, beforeDocumentScripts)
- Adds an user script to the document.
There are two ways to specify the script:
- Specifying the script only by an URI.
- Specifying the script by the content of the script and
alternatively setting a URI to resolve relative elements. If no URI
is specified then the system id/base URL of the document will be used.
param string content The content of the script.
param string URI The URI of the script.
param boolean beforeDocumentScripts Use True to cause PDFreactor to run the script before all scripts inside the document and False to run it after.
see removeAllUserScripts()
- addUserStyleSheet(self, content, media, title, URI)
- Adds a user style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the style sheet only using an URI.
- Specifying the style sheet by the content of the stylesheet 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.
param string content The content of the style sheet.
param string media The media type of the style sheet.
param string title The title of the stylesheet.
param string uri The URI of the style sheet.
see addUserStyleSheet(InputSource)
see removeAllUserStyleSheets()
- addXSLTStyleSheet(self, content, URI)
- Adds a XSLT style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the style sheet only using an URI.
- Specifying the style sheet by the content of the stylesheet 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.
param string content The content of the style sheet.
param string URI The URI of the style sheet.
see removeAllXSLTStyleSheets()
- enableDebugMode(self)
- Enables debug mode, which adds additional information to the output.
- getError(self)
- Returns the error messages generated during rendering.
return string The message string.
- getExceedingContents(self)
- Provides information about content exceeding its page or parent. Depends on the mode set via setLogExceedingContent(int, int).
return an array of ExceedingContent objects
or None if the logging of exceeding content was not enabled
or no conversion was run, yet.
return ExceedingContent[] The exceeding contents.
- getLog(self)
- Returns the log messages generated during rendering based on the log level.
return string The log string.
see setLogLevel()
- getNumberOfPages(self, value)
- Returns the number of pages of the document after conversion.
The result returned by this method will only be correct if the
document has already been laid out by one of the render methods:
see renderDocumentFromURLAsArray()
see renderDocumentFromByteArrayAsArray()
see renderDocumentFromContent()
param boolean pdf If True, 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.
- removeAllUserScripts(self)
- Removes all user scripts.
see addUserScript(string, string, boolean)
- removeAllUserStyleSheets(self)
- Removes all user style sheets.
see addUserStyleSheet(string,string,string,string)
see addUserStyleSheet(InputSource)
- removeAllXSLTStyleSheets(self)
- Removes all user style sheets.
see addXSLTStyleSheet(string, string)
- renderDocumentFromByteArray(self, byteArray)
- Generates a PDF document from an XML document inside a byte array.
The document can be specified by a byte array containing the content of the document.
param string byteArray A base64encoded binary string containing the content of the XML
document.
return string The PDF document as a base64encoded binary string.
see renderDocumentFromURL()
see renderDocumentFromContent()
see renderDocumentFromByteArrayAsArray()
- renderDocumentFromByteArrayAsArray(self, byteArray)
- Generates an array of byte-arrays each containing an image representing
one page of the document from an HTML or XML document inside a byte-array.
param array An array containing the content of the HTML or XML document.
return array An array of byte-arrays each containing an image representing one page of the document.
see renderDocumentFromURLAsArray()
see renderDocumentFromContentAsArray()
see renderDocumentFromByteArray()
- renderDocumentFromContent(self, content)
- Generates a PDF document from an XML document inside a string.
The document can be specified by a string containing the content of the document.
param string content A string containing the content of the XML document.
return string The PDF document as a base64encoded binary string.
see renderDocumentFromURL()
see renderDocumentFromByteArray()
see renderDocumentFromContentAsArray()
- renderDocumentFromContentAsArray(self, content)
- Generates an array of byte-arrays each containing an image representing
one page of the document from an HTML or XML document inside a String.
param content A String containing the content of the HTML or XML document.
return array An array of byte-arrays each containing an image representing one page of the document.
see renderDocumentFromURLAsArray()
see renderDocumentFromByteArrayAsArray()
see renderDocumentFromContent()
- renderDocumentFromURL(self, url)
- Generates a PDF document from an XML document at a URL.
The document can be specified by a URL pointing to the document.
param string url A URL pointing to the XML document.
return string The PDF document as a base64encoded binary string.
see renderDocumentFromByteArray()
see renderDocumentFromContent()
- renderDocumentFromURLAsArray(self, url)
- Generates an array of byte-arrays each containing an image representing
one page of the document from an HTML or XML document at a URL.
param string url A URL pointing to the input document.
return array An array of byte-arrays each containing an image representing one page of the document.
see renderDocumentFromByteArrayAsArray()
see renderDocumentFromContentAsArray()
see renderDocumentFromURL()
- setAddAttachments(self, value)
- Enables or disables attachments specified in style sheets.
The default value is False.
param boolean value Whether to enable CSS based attachments.
- setAddBookmarks(self, value)
- Enables or disables bookmarks in the PDF document.
The default value is False.
param boolean value Use True to enable bookmarks in the document and False
to disable bookmarks.
- setAddComments(self, value)
- Enabled of disables comments in the PDF document.
The default value is False.
param boolean value Use True to enable comments in the PDF document and False
to disable comments.
- setAddLinks(self, value)
- Enables or disables links in the PDF document.
The default value is False.
param boolean value Use True to enable links in the document and False to
disable links.
- setAddOverprint(self, value)
- Enables or disables overprinting.
The default value is False.
param boolean value Whether to enable overprinting.
- setAddPreviewImages(self, value)
- Enables or disables embedding of image previews per page in the PDF document.
The default value is False.
param boolean value Use True to enable embedding of image previews per page in
the document and False to disable embedding of image previews per page.
- setAddPrintDialogPrompt(self, value)
- Enables or disables a print dialog to be shown upon opening the generated PDF document by a
PDF viewer.
The default value is False.
param boolean value Use True to enable a print dialog to be shown upon document
opening by a PDF viewer and False to disable the print dialog prompt.
- setAddTags(self, value)
- Enables or disables tagging of PDF document.
The default value is False.
param boolean value Use True to enable tagging of the document and
False to disable tagging.
- setAllowAnnotations(self, value)
- Enables or disables the 'annotations' restriction in the PDF document.
The default value is False.
param boolean value Use True to enable 'annotations' in the document and
False to disable 'annotations'.
see setEncryption(int)
- setAllowAssembly(self, value)
- Enables or disables the 'assembly' restriction in the PDF document.
The default value is False.
param boolean value Use True to enable 'assembly' in the document and
False to disable 'assembly'.
see setEncryption(int)
- setAllowCopy(self, value)
- Enables or disables the 'copy' restriction in the PDF document.
The default value is False.
param boolean value Use True to enable 'copy' in the document and
False to disable 'copy'.
see setEncryption(int)
- setAllowDegradedPrinting(self, value)
- Enables or disables the 'degraded printing' restriction in the PDF
document.
The default value is False.
param boolean value Use True to enable 'degraded printing' in the document and
False to disable 'degraded printing'.
see setEncryption(int)
- setAllowFillIn(self, value)
- Enables or disables the 'fill in' restriction in the PDF document.
The default value is False.
param boolean value Use True to enable 'fill in' in the document and
False to disable 'fill in'.
see setEncryption(int)
- setAllowModifyContents(self, value)
- Enables or disables the 'modify contents' restriction in the PDF
document.
The default value is False.
param boolean value Use True to enable 'modify contents' in the document and
False to disable 'modify contents'.
see setEncryption(int)
- setAllowPrinting(self, value)
- Enables or disables the 'printing' restriction in the PDF document.
The default value is False.
param boolean value Use True to enable 'printing' in the document and
False to disable 'printing'.
see setEncryption(int)
- setAllowScreenReaders(self, value)
- Enables or disables the 'screen readers' restriction in the PDF
document.
The default value is False.
param boolean value Use True to enable 'screen readers' in the document and
False to disable 'screen readers'.
see setEncryption(int)
- setAppendLog(self, value)
- Specifies whether or not the log data should be added to the
PDF document.
The default value is False.
param boolean value Use True to add the log data to the document and
False if the log data should not be added.
- setAuthenticationCredentials(self, username, password)
- Enables access to resources that are secured via Basic or Digest authentication.
param string username The user name for the secured realm.
param string password The password for the secured realm.
- setAuthor(self, value)
- Sets the value of the author field of the PDF document.
param string value The author of the document.
- setBaseURL(self, value)
- Sets the base URL of the XML 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 None then it will be used
instead of the system id.
The default value is None.
param string value The base URL for the document.
- setBookletMode(self, sheetSize, sheetMargin, rtl)
- Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
param string sheetSize The size of the sheet as CSS value, e.g. 'A3', 'letter landscape', '15in 20in',
'20cm 30cm'.
param string sheetMargin The sheet margin as CSS margin, e.g. '1in', '1cm 1.5cm', '10mm 20mm 10mm 30mm'. 'None' is
interpreted as '0mm'.
param boolean rtl Whether or not the reading order of the booklet should be right-to-left.
- setCacheFonts(self, value)
- Enables or disables caching of font information.
During the PDF creation PDFreactor requires information about
fonts in the system. The process to get this information takes a
long time, thus PDFreactor offers an option to cache the collected
information about fonts.
A font cache can be reused by PDFreactor on every PDF creation
process but only if font registration is enabled. If font registration
is disabled then the font cache will be ignored. (see
setDisableFontRegistration(boolean) for more information).
The default value is True.
param boolean value The new value of the cache fonts setting.
see setDisableFontRegistration(boolean)
see setFontCachePath(string)
see addFontDirectory(string)
- setCleanupTool(self, value)
- Sets the cleanup tool to use for documents with unparsable content.
The 'CLEANUP_' constants can be used as value. The
default value specified is 'CLEANUP_CYBERNEKO'.
HTML5 utilizes an internal cleanup.
param int value The new cleanup tool.
see CLEANUP_NONE
see CLEANUP_JTIDY
see CLEANUP_CYBERNEKO
see CLEANUP_TAGSOUP
- setConformance(self, conformance)
- Sets the conformance of the PDF.
The 'CONFORMANCE_' constants can be used as value. The default
value specified is 'CONFORMANCE_PDF'.
param int conformance conformance constants.
see CONFORMANCE_PDF
see CONFORMANCE_PDFA1A
see CONFORMANCE_PDFA3A
- setContinuousOutput(self, width, height)
- Enables the conversion of the input document into one image.
param int width equivalent to the width of a browser window (view port). Values <1 enable paginated output
param int height equivalent to the height of a browser window (view port). For values <1 the entire height of the document is used.
- setCookie(self, key, value)
- Adds a cookie to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
param string key The key of the cookie.
param string value The value of the cookie.
- setCreator(self, value)
- Sets the value of creator field of the PDF document.
param string value The creator of the document.
- setDefaultColorSpace(self, defaultColorSpace)
- Sets whether to convert color key words to CMYK instead of RGB.
The 'COLOR_SPACE_' constants can be used as value.
The default value specified is 'COLOR_SPACE_RGB'.
param boolean defaultColorSpace whether to prefer CMYK.
see COLOR_SPACE_CMYK
see COLOR_SPACE_RGB
- setDisableFontEmbedding(self, value)
- Sets whether fonts will not be embedded into the resulting PDF.
Setting this to True will reduce the file size of the output document.
However, the resulting PDF documents are no longer guaranteed to look
identical on all systems.
The default value is False.
- setDisableFontRegistration(self, value)
- Enables or disables the font registration.
If font registration is enabled and a valid font cache exists, then this font cache will be
used. If font registration is disabled, any existing font cache will be ignored and the font
directories will be scanned for font information.
The default value is False.
param boolean value The new value of the font registration setting.
see setCacheFonts(boolean)
see setFontCachePath(string)
see addFontDirectory(string)
- setDisableSystemFonts(self, value)
- Enables or disables system fonts.
If system fonts are disabled, PDFreactor will neither scan for
system fonts nor use the respective font cache.
The default value is False.
param boolean value The new value of the font registration setting.
see setDisableFontRegistration(boolean)
see addFontDirectory(string)
- setDocumentDefaultLanguage(self, languageCode)
- 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.
param string languageCode the default ISO 639 language code used for documents.
- setDocumentType(self, value)
- Sets the document type.
The 'DOCTYPE_' constants can be used to specify the
document type. The default value specified is 'DOCTYPE_AUTODETECT'.
The default value specified by DOCTYPE_DEFAULT is DOCTYPE_AUTODETECT.
param int value The new document type setting.
see DOCTYPE_AUTODETECT
see DOCTYPE_XML
see DOCTYPE_XHTML
see DOCTYPE_HTML5
- setEncoding(self, value)
- Sets the encoding of the document.
If this value is set to None or it is empty then the encoding will be detected
automatically.
The default value is None.
param string value The encoding of the document or None for autodetection.
- setEncryption(self, value)
- Sets the encryption.
Use one of the following ENCRYPTION_ constants to specify the encryption:<br>
The default value specified is ENCRYPTION_NONE.
param int value The new encryption setting.
see #ENCRYPTION_NONE
see #ENCRYPTION_40
see #ENCRYPTION_128
see setOwnerPassword(string)
see setUserPassword(string)
see setAllowAnnotations(boolean)
see setAllowAssembly(boolean)
see setAllowCopy(boolean)
see setAllowDegradedPrinting(boolean)
see setAllowFillIn(boolean)
see setAllowModifyContents(boolean)
see setAllowPrinting(boolean)
see setAllowScreenReaders(boolean)
- setFontCachePath(self, location)
- Sets the path of the font cache.
This path will be used to read and write the font cache. If the font cache path is set to
None then the "user.home" directory will be used.
The default value is None.
param string location The path of the font cache.
see setDisableFontRegistration(boolean)
see setCacheFonts(boolean)
see addFontDirectory(string)
- setFontDirectory(self, location)
- deprecated. As of PDFreactor 6.0, replaced by addFontDirectory(String)
see addFontDirectory(String)
- setFontFallback(self, value)
- Sets a list of fallback font families used for character substitution. This
list is iterated for characters that can not be displayed with any of the fonts
specified via the CSS property font-family.
param string[] fontFallback an array of font family names
- setFullCompression(self, value)
- Enables or disables full compression of the PDF document.
The default value is False.
param boolean value True to enable full compression of the document and
False to disable full compression.
- setHTTPSMode(self, httpsMode)
- Sets the HTTPS Mode.
In closed environment lenient can be the preferred setting to avoid HTTPS issues that are not security critical.
The default value is 'HTTPS_MODE_STRICT'.
param int httpsMode The HTTPS mode.
see HTTPS_MODE_STRICT
see HTTPS_MODE_LENIENT
- setJavaScriptMode(self, javaScriptMode)
- Sets the JavaScript Mode.
The default value is 'JAVASCRIPT_MODE_DISABLED'.
param int javaScriptMode The JavaScript mode.
see JAVASCRIPT_MODE_DISABLED
see JAVASCRIPT_MODE_ENABLED
see JAVASCRIPT_MODE_ENABLED_NO_LAYOUT
see JAVASCRIPT_MODE_ENABLED_REAL_TIME
see JAVASCRIPT_MODE_ENABLED_TIME_LAPSE
- setKeywords(self, value)
- Sets the value of the keywords field of the PDF document.
param string value The keywords of the document.
- setLicenseKey(self, content)
- Sets the license key using a string.
The default value is None.
param string content The content of the license key as a string.
see setCacheFonts(boolean)
see setFontCachePath(string)
see addFontDirectory(string)
- setLogExceedingContent(self, logExceedingContentAnalyze, logExceedingContentAgainst)
- Whether to log content exceeding the page.
Use 'EXCEEDING_CONTENT_ANALYZE_' constants to specify
which kind of content should be observed for exceeding content logging.
The default value is 'EXCEEDING_CONTENT_ANALYZE_NONE'.
param int logExceedingContentAnalyze Enables logging of exceeding content and optionally of boxes.
param int logExceedingContentAgainst Enables logging of exceeding content either against the page edges, page content areas or containers.
see EXCEEDING_CONTENT_ANALYZE_NONE
see EXCEEDING_CONTENT_ANALYZE_CONTENT
see EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES
see EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES
see EXCEEDING_CONTENT_AGAINST_NONE
see EXCEEDING_CONTENT_AGAINST_PARENT
see EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT
see EXCEEDING_CONTENT_AGAINST_PAGE_BORDERS
- setLogLevel(self, value)
- Sets the log level.
Use one of the 'LOG_LEVEL_' constants to specify the log
param int value The new log level setting.
see LOG_LEVEL_NONE
see LOG_LEVEL_FATAL
see LOG_LEVEL_WARN
see LOG_LEVEL_INFO
see LOG_LEVEL_DEBUG
see LOG_LEVEL_PERFORMANCE
see LOG_LEVEL_DEFAULT
see getLog()
- setMergeBeforePDF(self, value)
- deprecated. As of PDFreactor 5.0, replaced by setMergeMode(int)
see setMergeMode(int)
- setMergeByteArray(self, value)
- This methods sets a byte array containing an external PDF document which will be merged with
the PDF document generated by the XML source.
The default value is None
param string base64string A base64encoded binary string containing the PDF RAW data.
see setMergeURL(string)
see setMergeURLs(string[])
see setMergeByteArrays(byte[][])
see setMergeMode(int)
- setMergeByteArrays(self, value)
- This method sets an array of several byte arrays containing external PDF
documents which will be merged with the PDF document generated by the XML source.
param byte[] base64strings An array of byte arrays containing multiple PDF RAW data.
see setMergeByteArray(byte[])
see setMergeURL(string)
see setMergeURLs(string[])
see setMergeMode(int)
- setMergeMode(self, value)
- Sets the merge mode.
The following merge methods can be used:
- append (MERGE_MODE_APPEND)
- prepend (MERGE_MODE_PREPEND)
- overlay above the content of the generated PDF (MERGE_MODE_OVERLAY)
- overlay below the content of the generated PDF (MERGE_MODE_OVERLAY_BELOW)
The default value is MERGE_MODE_APPEND.
see MERGE_MODE_APPEND
see MERGE_MODE_PREPEND
see MERGE_MODE_OVERLAY
see MERGE_MODE_OVERLAY_BELOW
- setMergeURL(self, value)
- This methods sets a URL of an external PDF document which will be merged with the PDF
document generated by the XML source.
The default value is None
param string url A URL of a PDF document.
see setMergeByteArray(byte[])
see setMergeBeforePDF(boolean)
- setMergeURLs(self, value)
- This method sets an array of URLs of external PDF documents which will be
merged with the PDF document generated by the XML source.
param string[] urls An array of URLs of PDF documents.
- setOutputFormat(self, format, outputWidth, outputHeight)
- Sets the output format. The default value is 'PDF'.
For image formats the width or height in pixels must be specified.
When either dimension is <1 it is computed based on the other dimension and the aspect ratio of the input document.
param format the output format. See 'OUTPUT_FORMAT_' constants
param outputWidth The width 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.
param outputHeight 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.
see OUTPUT_FORMAT_PDF
see OUTPUT_FORMAT_JPEG
see OUTPUT_FORMAT_PNG
see OUTPUT_FORMAT_PNG_TRANSPARENT
see OUTPUT_FORMAT_BMP
see OUTPUT_FORMAT_GIF
see OUTPUT_FORMAT_PNG_AI
see OUTPUT_FORMAT_PNG_TRANSPARENT_AI
see OUTPUT_FORMAT_TIFF_LZW
see OUTPUT_FORMAT_TIFF_PACKBITS
see OUTPUT_FORMAT_TIFF_UNCOMPRESSED
see OUTPUT_FORMAT_TIFF_CCITT_1D
see OUTPUT_FORMAT_TIFF_CCITT_GROUP_3
see OUTPUT_FORMAT_TIFF_CCITT_GROUP_4
- setOutputIntentFromByteArray(self, identifier, profileData)
- Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
param string identifier the OutputConditionIdentifier.
param string profileData the base64encoded binary content of the DestOutputProfile.
- setOutputIntentFromURL(self, identifier, profileUrl)
- Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
param string identifier the OutputConditionIdentifier.
param string profileUrl the DestOutputProfile.
- setOverlayRepeat(self, value)
- If one of the documents of an overlay process is shorter than the other, this method
allows repeating either its last page or all of its pages in order to overlay all pages of
the longer document.
Use one of the 'OBERLAY_REPEAT_' constants to specify the
overlay repeat. The default value is 'OVERLAY_REPEAT_NONE'.
see OVERLAY_REPEAT_NONE
see OVERLAY_REPEAT_LAST_PAGE
see OVERLAY_REPEAT_ALL_PAGES
The default value is OVERLAY_REPEAT_NONE.
- setOwnerPassword(self, value)
- Sets the owner password of the PDF document.
The default value is None
param string value The owner password.
see setEncryption(int)
see setUserPassword(string)
- setPageOrder(self, value)
- Sets the page order of the direct result of the conversion.
param string order A comma-separated list of page numbers and ranges is
intended as parameter. Alternatively, 'PAGE_ORDER_'
constants can be used.
see #PAGE_ORDER_EVEN
see #PAGE_ORDER_ODD
see #PAGE_ORDER_BOOKLET
see #PAGE_ORDER_BOOKLET_RTL
- setPagesPerSheetProperties(self, cols, rows, sheetSize, sheetMargin, spacing, direction)
- Sets the properties of a sheet on which multiple pages are being arranged.
If 'cols' or 'rows' is less than 1, no
pages-per-sheet processing is done. This is the case by default.
Use one of the 'PAGES_PER_SHEET_DIRECTION_' constants to
specify the the direction. The default value is 'PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN'
param int cols The number of columns per sheet.
param int rows The number of rows per sheet.
param string sheetSize The sheet size as CSS size, e.g. 'A4', 'letter landscape', '15in 20in',
'20cm 30cm'.
param string sheetMargin The sheet margin as CSS margin, e.g. '1in', '1cm 1.5cm', '10mm 20mm 10mm 30mm'. 'None' is
interpreted as '0mm'.
param string spacing The horizontal and vertical space between pages on a sheet as CSS value, e.g. '0.1in', '5mm 2mm'. 'None' is
interpreted as '0mm'.
param int direction The direction in which the pages are ordered on a sheet.
see #PAGES_PER_SHEET_DIRECTION_DOWN_LEFT
see #PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT
see #PAGES_PER_SHEET_DIRECTION_LEFT_DOWN
see #PAGES_PER_SHEET_DIRECTION_LEFT_UP
see #PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN
see #PAGES_PER_SHEET_DIRECTION_RIGHT_UP
see #PAGES_PER_SHEET_DIRECTION_UP_LEFT
see #PAGES_PER_SHEET_DIRECTION_UP_RIGHT
- setPixelsPerInch(self, value)
- Sets the pixels per inch.
Changing this value changes the physical length of sizes specified in px (including those
specified via HTML attributes).
The default value is 96ppi.
- setPixelsPerInchShrinkToFit(self, value)
- Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
- setPostTransformationDocumentType(self, value)
- Sets the document type after XSL-Transformations have been applied.
The 'DOCTYPE_' constants can be used to specify the
document type. The default value specified is 'DOCTYPE_AUTODETECT'.
param int value The new document type setting.
see DOCTYPE_AUTODETECT
see DOCTYPE_XML
see DOCTYPE_XHTML
see DOCTYPE_HTML5
- setProcessingPreferences(self, processingPreferences)
- Preferences that influence the conversion process without changing the output
Use the 'PROCESSING_PREFERENCES_' constants to specify the processing preferences.
By default no processing preference is set.
param int processingPreferences ORed processing preferences flags.
#see PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES
- setRequestHeader(self, key, value)
- "Adds a request header to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
param string key The key of the header.
param string value The value of the header.
- setSignPDF(self, keystoreURL, keyAlias, keystorePassword, keystoreType, signingMode)
- Sets a digital certificate to sign the newly created PDF.</p>
Requires a keystore file. The included certificate may be self-signed.</p>
Use the 'KEYSTORE_TYPE_' constants to specify the keystore type.
Use the 'SIGNING_MODE_' constants to specify the signing mode.
param string keystoreURL The URL to the keystore file.
param string keyAlias The alias of the certificate included in the keystore to be used to sign the PDF.
param string keystorePassword The password of the keystore.
param string keystoreType The format of the keystore, i.e. 'pkcs12' or 'jks'.
Use one of the 'KEYSTORE_TYPE_' constants as value.
param int signingMode The mode that is used to sign the PDF, i.e. 'self-signed',
'Windows certificate' or 'VeriSign'.
Use one of the 'SIGNING_MODE_' constants as value.
see KEYSTORE_TYPE_JKS
see KEYSTORE_TYPE_PKCS12
see SIGNING_MODE_SELF_SIGNED
see SIGNING_MODE_VERISIGN_SIGNED
see SIGNING_MODE_WINCER_SIGNED
- setSubject(self, value)
- Sets the value of the subject field of the PDF document.
param string value The subject of the document.
- setThrowLicenseExceptions(self, value)
- Whether an exception should be thrown when no legal full license key is set.
This allows to programmatically ensure that documents are not altered due to license issues.
The default value is False.
- setTitle(self, value)
- Sets the value of the title field of the PDF document.
param string value The title of the document.
- setUserPassword(self, value)
- Sets the user password of the PDF document.
The default value is None.
param string value The user password.
see setEncryption(int)
see setOwnerPassword(string)
- setViewerPreferences(self, viewerPreferences)
- Sets the page layout and page mode preferences of the PDF.
Use the 'VIEWER_PREFERENCES_' constants to specify the
viewer preferences. By default no viewer preference is set.
param int viewerPreferences ORed VIEWERPREFERENCES_ constants.
see #VIEWER_PREFERENCES_CENTER_WINDOW
see #VIEWER_PREFERENCES_DIRECTION_L2R
see #VIEWER_PREFERENCES_DIRECTION_R2L
see #VIEWER_PREFERENCES_DISPLAY_DOC_TITLE
see #VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE
see #VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE
see #VIEWER_PREFERENCES_DUPLEX_SIMPLEX
see #VIEWER_PREFERENCES_FIT_WINDOW
see #VIEWER_PREFERENCES_HIDE_MENUBAR
see #VIEWER_PREFERENCES_HIDE_TOOLBAR
see #VIEWER_PREFERENCES_HIDE_WINDOW_UI
see #VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE
see #VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC
see #VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES
see #VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS
see #VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN
see #VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE
see #VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT
see #VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT
see #VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT
see #VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT
see #VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN
see #VIEWER_PREFERENCES_PAGE_MODE_USE_NONE
see #VIEWER_PREFERENCES_PAGE_MODE_USE_OC
see #VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES
see #VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS
see #VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE
see #VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE
see #VIEWER_PREFERENCES_PRINTSCALING_APPDEFAULT
see #VIEWER_PREFERENCES_PRINTSCALING_NONE
- setXSLTMode(self, value)
- Enables or disables XSLT transformations.
Set this value to True to enable XSLT transformations or to False to disable
XSLT transformations.
The default value is False.
param boolean value The new XSLT mode.
Data and other attributes defined here:
- CLEANUP_CYBERNEKO = 2
- CLEANUP_DEFAULT = 2
- CLEANUP_JTIDY = 1
- CLEANUP_NONE = 0
- CLEANUP_TAGSOUP = 3
- COLOR_SPACE_CMYK = 1
- COLOR_SPACE_RGB = 0
- CONFORMANCE_DEFAULT = 0
- CONFORMANCE_PDF = 0
- CONFORMANCE_PDFA = 1
- CONFORMANCE_PDFA1A = 1
- CONFORMANCE_PDFA3A = 2
- DOCTYPE_AUTODETECT = 0
- DOCTYPE_DEFAULT = 0
- DOCTYPE_HTML5 = 3
- DOCTYPE_XHTML = 2
- DOCTYPE_XML = 1
- DOCUMENT_DEFAULT_LANGUAGE_DEFAULT = None
- ENCRYPTION_128 = 2
- ENCRYPTION_40 = 1
- ENCRYPTION_DEFAULT = 0
- ENCRYPTION_NONE = 0
- EXCEEDING_CONTENT_AGAINST_NONE = 0
- EXCEEDING_CONTENT_AGAINST_PAGE_BORDERS = 1
- EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT = 2
- EXCEEDING_CONTENT_AGAINST_PARENT = 3
- EXCEEDING_CONTENT_ANALYZE_CONTENT = 1
- EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES = 3
- EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES = 2
- EXCEEDING_CONTENT_ANALYZE_NONE = 0
- HTTPS_MODE_DEFAULT = 0
- HTTPS_MODE_LENIENT = 1
- HTTPS_MODE_STRICT = 0
- JAVASCRIPT_MODE_DEFAULT = 0
- JAVASCRIPT_MODE_DISABLED = 0
- JAVASCRIPT_MODE_ENABLED = 1
- JAVASCRIPT_MODE_ENABLED_NO_LAYOUT = 2
- JAVASCRIPT_MODE_ENABLED_REAL_TIME = 3
- JAVASCRIPT_MODE_ENABLED_TIME_LAPSE = 4
- KEYSTORE_TYPE_JKS = 'jks'
- KEYSTORE_TYPE_PKCS12 = 'pkcs12'
- LOG_LEVEL_DEBUG = 0
- LOG_LEVEL_DEFAULT = 4
- LOG_LEVEL_FATAL = 3
- LOG_LEVEL_INFO = 1
- LOG_LEVEL_NONE = 4
- LOG_LEVEL_PERFORMANCE = -1
- LOG_LEVEL_WARN = 2
- MERGE_MODE_APPEND = 1
- MERGE_MODE_OVERLAY = 3
- MERGE_MODE_OVERLAY_BELOW = 4
- MERGE_MODE_PREPEND = 2
- OUTPUT_FORMAT_BMP = 4
- OUTPUT_FORMAT_GIF = 5
- OUTPUT_FORMAT_JPEG = 1
- OUTPUT_FORMAT_PDF = 0
- OUTPUT_FORMAT_PNG = 2
- OUTPUT_FORMAT_PNG_AI = 6
- OUTPUT_FORMAT_PNG_TRANSPARENT = 3
- OUTPUT_FORMAT_PNG_TRANSPARENT_AI = 7
- OUTPUT_FORMAT_TIFF_CCITT_1D = 11
- OUTPUT_FORMAT_TIFF_CCITT_GROUP_3 = 12
- OUTPUT_FORMAT_TIFF_CCITT_GROUP_4 = 13
- OUTPUT_FORMAT_TIFF_LZW = 8
- OUTPUT_FORMAT_TIFF_PACKBITS = 9
- OUTPUT_FORMAT_TIFF_UNCOMPRESSED = 10
- OVERLAY_REPEAT_ALL_PAGES = 2
- OVERLAY_REPEAT_LAST_PAGE = 1
- OVERLAY_REPEAT_NONE = 0
- PAGES_PER_SHEET_DIRECTION_DOWN_LEFT = 5
- PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT = 4
- PAGES_PER_SHEET_DIRECTION_LEFT_DOWN = 1
- PAGES_PER_SHEET_DIRECTION_LEFT_UP = 3
- PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN = 0
- PAGES_PER_SHEET_DIRECTION_RIGHT_UP = 2
- PAGES_PER_SHEET_DIRECTION_UP_LEFT = 7
- PAGES_PER_SHEET_DIRECTION_UP_RIGHT = 6
- PAGE_ORDER_BOOKLET = 'BOOKLET'
- PAGE_ORDER_BOOKLET_RTL = 'BOOKLET_RTL'
- PAGE_ORDER_EVEN = 'EVEN'
- PAGE_ORDER_ODD = 'ODD'
- PAGE_ORDER_REVERSE = 'REVERSE'
- PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES = 1
- SIGNING_MODE_SELF_SIGNED = 1
- SIGNING_MODE_VERISIGN_SIGNED = 2
- SIGNING_MODE_WINCER_SIGNED = 3
- VIEWER_PREFERENCES_CENTER_WINDOW = 65536
- VIEWER_PREFERENCES_DIRECTION_L2R = 4194304
- VIEWER_PREFERENCES_DIRECTION_R2L = 8388608
- VIEWER_PREFERENCES_DISPLAY_DOC_TITLE = 131072
- VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE = 268435456
- VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE = 134217728
- VIEWER_PREFERENCES_DUPLEX_SIMPLEX = 67108864
- VIEWER_PREFERENCES_FIT_WINDOW = 32768
- VIEWER_PREFERENCES_HIDE_MENUBAR = 8192
- VIEWER_PREFERENCES_HIDE_TOOLBAR = 4096
- VIEWER_PREFERENCES_HIDE_WINDOW_UI = 16384
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE = 262144
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC = 2097152
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES = 524288
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS = 1048576
- VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN = 2
- VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE = 1
- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT = 4
- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT = 8
- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT = 16
- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT = 32
- VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN = 512
- VIEWER_PREFERENCES_PAGE_MODE_USE_ATTACHMENTS = 2048
- VIEWER_PREFERENCES_PAGE_MODE_USE_NONE = 64
- VIEWER_PREFERENCES_PAGE_MODE_USE_OC = 1024
- VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES = 128
- VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS = 256
- VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE = 536870912
- VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE = 1073741824
- VIEWER_PREFERENCES_PRINTSCALING_APPDEFAULT = 33554432
- VIEWER_PREFERENCES_PRINTSCALING_NONE = 16777216
|
|