Class: PDFreactor
- Inherits:
-
Object
- Object
- PDFreactor
- Defined in:
- PDFreactor.rb
Constant Summary
- CLEANUP_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.
0- CLEANUP_JTIDY =
Indicates that JTidy will be used to perform a cleanup when loading a non-well-formed document.
1- CLEANUP_CYBERNEKO =
Indicates that the CyberNeko HTML parser will be used to perform a cleanup when loading a non-well-formed document.
2- CLEANUP_TAGSOUP =
Indicates that tagsoup will be used to perform a cleanup when loading a non-well-formed document.
3- DOCTYPE_AUTODETECT =
Indicates that the document type will be detected automatically.
A document has the type DOCTYPE_HTML5 if the name of the root element is "html" (ignoring case considerations). In all other cases the document type is DOCTYPE_XML.
0- DOCTYPE_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.
1- DOCTYPE_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.
2- DOCTYPE_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.
3- DOCUMENT_DEFAULT_LANGUAGE_DEFAULT =
Indicates the Default language used for a document if no other language is set in the document itself.
nil- 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.
0- ENCRYPTION_40 =
Indicates that the document will be encrypted using 40 bit encryption.
1- ENCRYPTION_128 =
Indicates that the document will be encrypted using 128 bit encryption.
For normal purposes this value should be used.
2- KEYSTORE_TYPE_PKCS12 =
Keystore type "pkcs12".
"pkcs12"- KEYSTORE_TYPE_JKS =
Keystore type "jks".
"jks"- SIGNING_MODE_SELF_SIGNED =
Signing mode for self-signed certificates.
1- SIGNING_MODE_VERISIGN_SIGNED =
Signing mode for VeriSign certificates.
2- SIGNING_MODE_WINCER_SIGNED =
Signing mode for Windows certificates.
3- LOG_LEVEL_NONE =
Indicates that no log events will be logged.
4- LOG_LEVEL_FATAL =
Indicates that only fatal log events will be logged.
3- LOG_LEVEL_WARN =
Indicates that warn and fatal log events will be logged.
2- LOG_LEVEL_INFO =
Indicates that info, warn and fatal log events will be logged.
1- LOG_LEVEL_DEBUG =
Indicates that debug, info, warn and fatal log events will be logged.
0- LOG_LEVEL_PERFORMANCE =
Indicates that all log events will be logged.
-1- VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE =
Display one page at a time. (default)
1- VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN =
Display the pages in one column.
2- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT =
Display the pages in two columns, with odd numbered pages on the left.
4- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT =
Display the pages in two columns, with odd numbered pages on the right.
8- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT =
Display two pages at a time, with odd numbered pages on the left.
16- VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT =
Display two pages at a time, with odd numbered pages on the right.
32- VIEWER_PREFERENCES_PAGE_MODE_USE_NONE =
Show no panel on startup.
64- VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES =
Show document outline panel on startup.
128- VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS =
Show thumbnail images panel on startup.
256- VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN =
Switch to fullscreen mode on startup.
512- VIEWER_PREFERENCES_PAGE_MODE_USE_OC =
Show optional content group panel on startup.
1024- VIEWER_PREFERENCES_PAGE_MODE_USE_ATTACHMENTS =
Show attachments panel on startup.
2048- VIEWER_PREFERENCES_HIDE_TOOLBAR =
Hide the viewer application’s tool bars when the document is active.
1 << 12
- VIEWER_PREFERENCES_HIDE_MENUBAR =
Hide the viewer application’s menu bar when the document is active.
1 << 13
- VIEWER_PREFERENCES_HIDE_WINDOW_UI =
Hide user interface elements in the document’s window.
1 << 14
- VIEWER_PREFERENCES_FIT_WINDOW =
Resize the document’s window to fit the size of the first displayed page.
1 << 15
- VIEWER_PREFERENCES_CENTER_WINDOW =
Position the document’s window in the center of the screen.
1 << 16
- VIEWER_PREFERENCES_DISPLAY_DOC_TITLE =
Display the document’s title in the top bar.
1 << 17
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE =
Show document outline panel on exiting full-screen mode. Has to be combined with VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
1 << 18
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES =
Show thumbnail images panel on exiting full-screen mode. Has to be combined with VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
1 << 19
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS =
Show optional content group panel on exiting full-screen mode. Has to be combined with VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
1 << 20
- VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC =
Show attachments panel on exiting full-screen mode. Has to be combined with VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
1 << 21
- VIEWER_PREFERENCES_DIRECTION_L2R =
Position pages in ascending order from left to right.
1 << 22
- VIEWER_PREFERENCES_DIRECTION_R2L =
Position pages in ascending order from right to left.
1 << 23
- VIEWER_PREFERENCES_PRINTSCALING_NONE =
Print dialog default setting: disabled scaling.
1 << 24
- VIEWER_PREFERENCES_PRINTSCALING_APPDEFAULT =
Print dialog default setting: set scaling to application default value.
1 << 25
- VIEWER_PREFERENCES_DUPLEX_SIMPLEX =
Print dialog default setting: simplex.
1 << 26
- VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE =
Print dialog default setting: duplex (short edge).
1 << 27
- VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE =
Print dialog default setting: duplex (long edge).
1 << 28
- VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE =
Print dialog default setting: do not pick tray by PDF size.
1 << 29
- VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE =
Print dialog default setting: pick tray by PDF size.
1 << 30
- COLOR_SPACE_RGB =
The color space RGB
0- COLOR_SPACE_CMYK =
The color space CMYK
1- CONFORMANCE_PDF =
PDF with no additional restrictions (default)
0- CONFORMANCE_PDFA1A =
PDF/A-1a (ISO 19005-1 Level A)
1- CONFORMANCE_PDFA3A =
PDF/A-3a (ISO 19005-3 Level A)
2- CONFORMANCE_PDFA =
Deprecated.
since PDFreactor 7.0. Use CONFORMANCE_PDFA1A instead.
CONFORMANCE_PDFA1A- PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES =
Processing preferences flag for the memory saving mode for images
1- MERGE_MODE_APPEND =
Default merge mode: Append converted document to existing PDF.
1- MERGE_MODE_PREPEND =
Alternate merge mode: Prepend converted document to existing PDF.
2- MERGE_MODE_OVERLAY =
Alternate merge mode (overlay): Adding converted document above the existing PDF.
3- MERGE_MODE_OVERLAY_BELOW =
Alternate merge mode (overlay): Adding converted document below the existing PDF.
4- OVERLAY_REPEAT_NONE =
No pages of the shorter document are repeated, leaving some pages of the longer document without overlay.
0- OVERLAY_REPEAT_LAST_PAGE =
Last page of the shorter document is repeated, to overlay all pages of the longer document.
1- OVERLAY_REPEAT_ALL_PAGES =
All pages of the shorter document are repeated, to overlay all pages of the longer document.
2- PAGE_ORDER_REVERSE =
Page order mode to reverse the page order.
"REVERSE"- PAGE_ORDER_ODD =
Page order mode to keep odd pages only.
"ODD"- PAGE_ORDER_EVEN =
Page order mode to keep even pages only.
"EVEN"- PAGE_ORDER_BOOKLET =
Page order mode to arrange all pages in booklet order.
"BOOKLET"- PAGE_ORDER_BOOKLET_RTL =
Page order mode to arrange all pages in right-to-left booklet order.
"BOOKLET_RTL"- PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN =
Arranges the pages on a sheet from left to right and top to bottom.
0- PAGES_PER_SHEET_DIRECTION_LEFT_DOWN =
Arranges the pages on a sheet from right to left and top to bottom.
1- PAGES_PER_SHEET_DIRECTION_RIGHT_UP =
Arranges the pages on a sheet from left to right and bottom to top.
2- PAGES_PER_SHEET_DIRECTION_LEFT_UP =
Arranges the pages on a sheet from right to left and bottom to top.
3- PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT =
Arranges the pages on a sheet from top to bottom and left to right.
4- PAGES_PER_SHEET_DIRECTION_DOWN_LEFT =
Arranges the pages on a sheet from top to bottom and right to left.
5- PAGES_PER_SHEET_DIRECTION_UP_RIGHT =
Arranges the pages on a sheet from bottom to top and left to right.
6- PAGES_PER_SHEET_DIRECTION_UP_LEFT =
Arranges the pages on a sheet from bottom to top and right to left.
7- EXCEEDING_CONTENT_ANALYZE_NONE =
Do not log exceeding content.
0- EXCEEDING_CONTENT_ANALYZE_CONTENT =
Log exceeding content.
1- EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES =
Log exceeding content and boxes without absolute positioning.
2- EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES =
Log exceeding content and all boxes.
3- EXCEEDING_CONTENT_AGAINST_NONE =
Do not log exceeding content.
0- EXCEEDING_CONTENT_AGAINST_PAGE_BORDERS =
Log content exceeding the edges of its page.
1- EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT =
Log content exceeding its page content area (overlaps the page margin).
2- EXCEEDING_CONTENT_AGAINST_PARENT =
Log content exceeding its container.
3- JAVASCRIPT_MODE_DISABLED =
Indicates that JavaScript is disabled.
0- JAVASCRIPT_MODE_ENABLED =
Indicates that JavaScript is enabled.
1- JAVASCRIPT_MODE_ENABLED_NO_LAYOUT =
Indicates that JavaScript is enabled, without access to layout data.
2- JAVASCRIPT_MODE_ENABLED_REAL_TIME =
Indicates that JavaScript is enabled, without converter-specific optimizations to timeouts and intervals. This mode is significantly more time consuming and should only be used when no other mode provides the expected results.
3- JAVASCRIPT_MODE_ENABLED_TIME_LAPSE =
Indicates that JavaScript is enabled, with time stamps increasing more quickly. This makes some kinds of JS based animations (e.g. when using jQuery) finish immediately, which has the same effect as JAVASCRIPT_MODE_ENABLED_REAL_TIME, but is significantly faster. Only Date.getTime() is affected by this.
4- HTTPS_MODE_STRICT =
Indicates strict HTTPS behavior. This matches the default behavior of Java.
0- HTTPS_MODE_LENIENT =
Indicates lenient HTTPS behavior. This means that many certificate issues are ignored.
1- OUTPUT_FORMAT_PDF =
PDF output format
0- OUTPUT_FORMAT_JPEG =
JPEG output format
1- OUTPUT_FORMAT_PNG =
PNG output format
2- OUTPUT_FORMAT_PNG_TRANSPARENT =
Transparent PNG output format
3- OUTPUT_FORMAT_BMP =
BMP output format
4- OUTPUT_FORMAT_GIF =
GIF output format
5- OUTPUT_FORMAT_PNG_AI =
PNG output format (using Apache Imaging)
6- OUTPUT_FORMAT_PNG_TRANSPARENT_AI =
Transparent PNG output format (using Apache Imaging)
7- OUTPUT_FORMAT_TIFF_LZW =
LZW compressed TIFF output format
8- OUTPUT_FORMAT_TIFF_PACKBITS =
PackBits compressed TIFF output format
9- OUTPUT_FORMAT_TIFF_UNCOMPRESSED =
Uncompressed TIFF output format
10- OUTPUT_FORMAT_TIFF_CCITT_1D =
Monochrome CCITT 1D compressed TIFF output format
11- OUTPUT_FORMAT_TIFF_CCITT_GROUP_3 =
Monochrome CCITT Group 3 compressed TIFF output format
12- OUTPUT_FORMAT_TIFF_CCITT_GROUP_4 =
Monochrome CCITT Group 4 compressed TIFF output format
13
Instance Method Summary (collapse)
-
- addAttachment(data, url, name, description)
Adds a file attachment to PDF document.
-
- addCustomDocumentProperty(name, value)
Adds a custom property to the PDF document.
-
- addFont(source, family, bold, italic)
Loads a font from a URL which can be used via the CSS property "font-family".
-
- addFontAlias(source, family, bold, italic)
Registers an alias font family for an existing font.
-
- addFontDirectory(value)
Registers an additional font directory to load fonts from.
-
- addUserScript(content, uri, beforeDocumentScripts)
Adds an user script to the document.
-
- addUserStyleSheet(content, media, title, uri)
Adds a user style sheet to the document.
-
- addXSLTStyleSheet(content, uri)
Adds a XSLT style sheet to the document.
-
- enableDebugMode
Enables debug mode, which adds additional information to the output.
-
- (string) getError
Returns the error messages generated during rendering.
-
- (array) getExceedingContents
Provides information about content exceeding its page or parent.
-
- (string) getLog
Returns the log messages generated during rendering based on the log level.
-
- getNumberOfPages(pdf)
Returns the number of pages of the document after conversion.
-
- (PDFreactor) initialize(host = "localhost", port = 9423)
constructor
Constructor.
-
- removeAllUserScripts
Removes all user scripts.
-
- removeAllUserStyleSheets
Removes all user style sheets.
-
- removeAllXSLTStyleSheets
Removes all XSLT style sheets.
-
- (binary) renderDocumentFromByteArray(byteArray)
Generates a PDF document from a XML document based on the current settings.
-
- (array) renderDocumentFromByteArrayAsArray(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.
-
- (binary) renderDocumentFromContent(content)
Generates a PDF document from a XML document based on the current settings.
-
- (array) renderDocumentFromContentAsArray(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.
-
- (binary) renderDocumentFromURL(url)
Generates a PDF document from a XML document based on the current settings.
-
- (array) renderDocumentFromURLAsArray(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.
-
- setAddAttachments(value)
Enables or disables attachments specified in style sheets.
-
- setAddBookmarks(value)
Enables or disables bookmarks in the PDF document.
-
- setAddComments(value)
Enables or disables comments in the PDF document.
-
- setAddLinks(value)
Enables or disables links in the PDF document.
-
- setAddOverprint(value)
Enables or disables overprinting.
-
- setAddPreviewImages(value)
Enables or disables embedding of image previews per page in the PDF document.
-
- setAddTags(value)
Enables or disables tagging of PDF document.
-
- setAllowAnnotations(value)
Enables or disables the ‘annotations’ restriction in the PDF document.
-
- setAllowAssembly(value)
Enables or disables the ‘assembly’ restriction in the PDF document.
-
- setAllowCopy(value)
Enables or disables the ‘copy’ restriction in the PDF document.
-
- setAllowDegradedPrinting(value)
Enables or disables the ‘degraded printing’ restriction in the PDF document.
-
- setAllowFillIn(value)
Enables or disables the ‘fill in’ restriction in the PDF document.
-
- setAllowModifyContents(value)
Enables or disables the ‘modify contents’ restriction in the PDF document.
-
- setAllowPrinting(value)
Enables or disables the ‘printing’ restriction in the PDF document.
-
- setAllowScreenReaders(value)
Enables or disables the ‘screen readers’ restriction in the PDF document.
-
- setAppendLog(value)
Specifies whether or not the log data should be added to the PDF document.
-
- setAuthenticationCredentials(authenticationUsername, authenticationPassword)
Enables access to resources that are secured via Basic or Digest authentication.
-
- setAuthor(value)
Sets the value of the author field of the PDF document.
-
- setBaseURL(value)
Sets the base URL of the XML document.
-
- setBookletMode(sheetSize, sheetMargin, rtl)
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
-
- setCacheFonts(value)
Enables or disables caching of font information.
-
- setCleanupTool(value)
Sets the cleanup tool to use for documents with unparsable content.
-
- setConformance(conformance)
Sets the conformance of the PDF.
-
- setContinuousOutput(width, height)
Enables the conversion of the input document into one image.
-
- setCookie(key, value)
Adds a cookie to all outgoing HTTP connections.
-
- setCreator(value)
Sets the value of creator field of the PDF document.
-
- setDefaultColorSpace(defaultColorSpace)
Sets whether to convert color key words to CMYK instead of RGB.
-
- setDisableFontEmbedding(disableFontEmbedding)
Sets whether fonts will not be embedded into the resulting PDF.
-
- setDisableFontRegistration(value)
Enables or disables the font registration.
-
- setDisableSystemFonts(value)
Enables or disables system fonts.
-
- setDocumentDefaultLanguage(languageCode)
Sets the language used for documents having no explicit language attribute set.
-
- setDocumentType(value)
Sets the document type.
-
- setEncoding(value)
Sets the encoding of the document.
-
- setEncryption(value)
Sets the encryption.
-
- setFontCachePath(value)
Sets the path of the font cache.
-
- setFontDirectory(value)
Deprecated
Deprecated.
since PDFreactor 6. Use #addFontDirectory instead.
-
- setFontFallback(fontArray)
Sets a list of fallback font families used for character substitution.
-
- setFullCompression(value)
Enables or disables full compression of the PDF document.
-
- setHTTPSMode(value)
Sets the HTTPS Mode.
-
- setJavaScriptMode(value)
Sets the JavaScript Mode.
-
- setKeywords(value)
Sets the value of the keywords field of the PDF document.
-
- setLicenseKey(content)
Sets the license key using a string.
-
- setLogExceedingContent(logExceedingContentAnalyze, logExceedingContentAgainst)
Whether to log content exceeding the page.
-
- setLogLevel(value)
Sets the log level.
-
- setMergeBeforePDF(mergeXMLBeforePDF)
Deprecated
Deprecated.
since PDFreactor 5. Use #setMergeMode instead.
-
- setMergeByteArray(byteArray)
This methods sets a byte array containing an external PDF document which will be merged with the PDF document generated by the XML source.
-
- setMergeByteArrays(byteArrays)
This method sets an array of byte arrays that contain multiple external PDFs which will be merged with the PDF document generated by the XML source.
-
- setMergeMode(mergeMode)
Sets the merge mode.
-
- setMergeURL(url)
This methods sets a URL of an external PDF document which will be merged with the PDF document generated by the XML source.
-
- setMergeURLs(urlArray)
This method sets an array of URLs of external PDF documents which will be merged with the PDF document generated by the XML source.
-
- setOutputFormat(format, width, height)
Sets the output format.
-
- setOutputIntentFromByteArray(identifier, profileData)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
-
- setOutputIntentFromURL(identifier, profileUrl)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
-
- setOverlayRepeat(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.
-
- setOwnerPassword(value)
Sets the owner password of the PDF document.
-
- setPageOrder(order)
Sets the page order of the direct result of the conversion.
-
- setPagesPerSheetProperties(cols, rows, sheetSize, sheetMargin, spacing, direction)
Sets the properties of a sheet on which multiple pages are being arranged.
-
- setPixelsPerInch(ppi)
Sets the pixels per inch.
-
- setPixelsPerInchShrinkToFit(pixelsPerInchShrinkToFit)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
-
- setPostTransformationDocumentType(value)
Sets the document type after XSL-Transformations have been applied.
-
- setPrintDialogPrompt(value)
Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.
-
- setProcessingPreferences(processingPreferences)
Preferences that influence the conversion process without changing the output.
-
- setRequestHeader(key, value)
Adds a request header to all outgoing HTTP connections.
-
- setSignPDF(keystoreURL, keyAlias, keystorePassword, keystoreType, signingMode)
Sets a digital certificate to sign the newly created PDF.
-
- setSubject(value)
Sets the value of the subject field of the PDF document.
-
- setThrowLicenseExceptions(throwLicenseExceptions)
Whether an exception should be thrown when no legal full license key is set.
-
- setTitle(value)
Sets the value of the title field of the PDF document.
-
- setUserPassword(value)
Sets the user password of the PDF document.
-
- setViewerPreferences(viewerPreferences)
Sets the page layout and page mode preferences of the PDF.
-
- setXSLTMode(value)
Enables or disables XSLT transformations.
Constructor Details
- (PDFreactor) initialize(host = "localhost", port = 9423)
Constructor
845 846 847 848 849 850 851 852 |
# File 'PDFreactor.rb', line 845 def initialize(host="localhost", port=9423) target = "http://"+host+":"+port.to_s+"/pdfreactor/services/PDFreactor" @client = ROClient.new(host, port, "/pdfreactor/services/PDFreactor", false) @client.connection.read_timeout = 300 @config = PDFreactorWebserviceConfiguration.new() end |
Instance Method Details
- addAttachment(data, url, name, description)
Adds a file attachment to PDF document.
1384 1385 1386 1387 1388 1389 1390 1391 1392 |
# File 'PDFreactor.rb', line 1384 def addAttachment(data, url, name, description) = { "url" => url, "data" => data, "name" => name, "description" => description } if @config.in1["attachments"] == nil @config.in1["attachments"] = [] end @config.in1["attachments"] << end |
- addCustomDocumentProperty(name, value)
Adds a custom property to the PDF document. An existing property of the same name will be replaced.
1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 |
# File 'PDFreactor.rb', line 1365 def addCustomDocumentProperty(name, value) customDocumentPropertyArray = [] customDocumentPropertyArray << name customDocumentPropertyArray << value if @config.in1["customDocumentProperties"] == nil @config.in1["customDocumentProperties"] = [] end @config.in1["customDocumentProperties"] << customDocumentPropertyArray end |
- addFont(source, family, bold, italic)
Loads a font from a URL which can be used via the CSS property "font-family".
909 910 911 912 913 914 915 916 917 |
# File 'PDFreactor.rb', line 909 def addFont(source,family,bold,italic) font = { "source" => source, "family" => family, "bold" => bold, "italic" => italic } if @config.in1["fonts"] == nil @config.in1["fonts"] = [] end @config.in1["fonts"] << font end |
- addFontAlias(source, family, bold, italic)
Registers an alias font family for an existing font.
This function is limited to fonts loaded automatically from system folders.
927 928 929 930 931 932 933 934 935 |
# File 'PDFreactor.rb', line 927 def addFontAlias(source,family,bold,italic) font = { "source" => source, "family" => family, "bold" => bold, "italic" => italic } if @config.in1["fontAliases"] == nil @config.in1["fontAliases"] = [] end @config.in1["fontAliases"] << font end |
- addFontDirectory(value)
Registers an additional font directory to load fonts from.
981 982 983 984 985 986 987 |
# File 'PDFreactor.rb', line 981 def addFontDirectory(value) if @config.in1["fontDirectories"] == nil @config.in1["fontDirectories"] = [] end @config.in1["fontDirectories"] << value end |
- addUserScript(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.
1304 1305 1306 1307 1308 1309 1310 1311 1312 |
# File 'PDFreactor.rb', line 1304 def addUserScript(content, uri, beforeDocumentScripts) script = { "content" => content, "URI" => uri, "beforeDocumentScripts" => beforeDocumentScripts } if @config.in1["userScripts"] == nil @config.in1["userScripts"] = [] end @config.in1["userScripts"] << script end |
- addUserStyleSheet(content, media, title, uri)
Adds a user style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the stylesheet only using an URI.
- Specifying the stylesheet 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.
1242 1243 1244 1245 1246 1247 1248 1249 1250 |
# File 'PDFreactor.rb', line 1242 def addUserStyleSheet(content, media, title, uri) style = { "URI" => uri, "content" => content, "media" => media, "title" => title } if @config.in1["userStyleSheets"] == nil @config.in1["userStyleSheets"] = [] end @config.in1["userStyleSheets"] << style end |
- addXSLTStyleSheet(content, uri)
Adds a XSLT style sheet to the document.
There are two ways to specify the style sheet:
- Specifying the stylesheet only using an URI.
- Specifying the stylesheet 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.
1273 1274 1275 1276 1277 1278 1279 1280 1281 |
# File 'PDFreactor.rb', line 1273 def addXSLTStyleSheet(content, uri) style = { "URI" => uri, "content" => content } if @config.in1["XSLTStyleSheets"] == nil @config.in1["XSLTStyleSheets"] = [] end @config.in1["XSLTStyleSheets"] << style end |
- enableDebugMode
Enables debug mode, which adds additional information to the output.
2075 2076 2077 |
# File 'PDFreactor.rb', line 2075 def enableDebugMode() @config.in1["enableDebugMode"] = true end |
- (string) getError
Returns the error messages generated during rendering.
2199 2200 2201 |
# File 'PDFreactor.rb', line 2199 def getError return @result.error end |
- (array) getExceedingContents
Provides information about content exceeding its page or parent. Depends on the mode set via #setLogExceedingContent.
2214 2215 2216 |
# File 'PDFreactor.rb', line 2214 def getExceedingContents return @result.exceedingContents end |
- (string) getLog
Returns the log messages generated during rendering based on the log level.
2207 2208 2209 |
# File 'PDFreactor.rb', line 2207 def getLog return @result.log end |
- getNumberOfPages(pdf)
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:
otherwise it will return the number of pages of the laid out input document.
2229 2230 2231 2232 2233 2234 2235 |
# File 'PDFreactor.rb', line 2229 def getNumberOfPages(pdf) if pdf return @result.numberOfPagesPDF else return @result.numberOfPages end end |
- removeAllUserScripts
Removes all user scripts.
1317 1318 1319 |
# File 'PDFreactor.rb', line 1317 def removeAllUserScripts() @config.in1["userScripts"] = nil end |
- removeAllUserStyleSheets
Removes all user style sheets.
1255 1256 1257 |
# File 'PDFreactor.rb', line 1255 def removeAllUserStyleSheets @config.in1["userStyleSheets"] = nil end |
- removeAllXSLTStyleSheets
Removes all XSLT style sheets.
1286 1287 1288 |
# File 'PDFreactor.rb', line 1286 def removeAllXSLTStyleSheets @config.in1["XSLTStyleSheets"] = nil end |
- (binary) renderDocumentFromByteArray(byteArray)
Generates a PDF document from a XML document based on the current settings.
The document can be specified by a byte array containing the content of the document.
2120 2121 2122 2123 2124 2125 |
# File 'PDFreactor.rb', line 2120 def renderDocumentFromByteArray(byteArray) args = { "in0" => byteArray, "in1" => @config.in1 } @result = @client.ROCall("renderDocumentFromByteArray", args) return @result.pdf end |
- (array) renderDocumentFromByteArrayAsArray(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.
2169 2170 2171 2172 2173 2174 |
# File 'PDFreactor.rb', line 2169 def renderDocumentFromByteArrayAsArray(byteArray) args = { "in0" => byteArray, "in1" => @config.in1 } @result = @client.ROCall("renderDocumentFromByteArrayAsArray", args) return @result.outputArray end |
- (binary) renderDocumentFromContent(content)
Generates a PDF document from a XML document based on the current settings.
The document can be specified by a string containing the content of the document.
2137 2138 2139 2140 2141 2142 |
# File 'PDFreactor.rb', line 2137 def renderDocumentFromContent(content) args = { "in0" => content, "in1" => @config.in1 } @result = @client.ROCall("renderDocumentFromContent", args) return @result.pdf end |
- (array) renderDocumentFromContentAsArray(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.
2185 2186 2187 2188 2189 2190 |
# File 'PDFreactor.rb', line 2185 def renderDocumentFromContentAsArray(content) args = { "in0" => content, "in1" => @config.in1 } @result = @client.ROCall("renderDocumentFromContentAsArray", args) return @result.outputArray end |
- (binary) renderDocumentFromURL(url)
Generates a PDF document from a XML document based on the current settings.
The document can be specified by a URL pointing to the document.
2103 2104 2105 2106 2107 2108 |
# File 'PDFreactor.rb', line 2103 def renderDocumentFromURL(url) args = { "in0" => url, "in1" => @config.in1 } @result = @client.ROCall("renderDocumentFromURL", args) return @result.pdf end |
- (array) renderDocumentFromURLAsArray(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.
2153 2154 2155 2156 2157 2158 |
# File 'PDFreactor.rb', line 2153 def renderDocumentFromURLAsArray(url) args = { "in0" => url, "in1" => @config.in1 } @result = @client.ROCall("renderDocumentFromURLAsArray", args) return @result.outputArray end |
- setAddAttachments(value)
Enables or disables attachments specified in style sheets. The default value is false.
1556 1557 1558 |
# File 'PDFreactor.rb', line 1556 def setAddAttachments(value) @config.in1["addAttachments"] = value end |
- setAddBookmarks(value)
Enables or disables bookmarks in the PDF document.
The default value is false.
1521 1522 1523 |
# File 'PDFreactor.rb', line 1521 def setAddBookmarks(value) @config.in1["addBookmarks"] = value end |
- setAddComments(value)
Enables or disables comments in the PDF document.
The default value is false.
1539 1540 1541 |
# File 'PDFreactor.rb', line 1539 def setAddComments(value) @config.in1["addComments"] = value end |
- setAddLinks(value)
Enables or disables links in the PDF document.
The default value is false.
1512 1513 1514 |
# File 'PDFreactor.rb', line 1512 def setAddLinks(value) @config.in1["addLinks"] = value end |
- setAddOverprint(value)
Enables or disables overprinting. The default value is false.
1564 1565 1566 |
# File 'PDFreactor.rb', line 1564 def setAddOverprint(value) @config.in1["addOverprint"] = value end |
- setAddPreviewImages(value)
Enables or disables embedding of image previews per page in the PDF document.
The default value is false.
1548 1549 1550 |
# File 'PDFreactor.rb', line 1548 def setAddPreviewImages(value) @config.in1["addPreviewImages"] = value end |
- setAddTags(value)
Enables or disables tagging of PDF document.
The default value is false.
1530 1531 1532 |
# File 'PDFreactor.rb', line 1530 def setAddTags(value) @config.in1["addTags"] = value end |
- setAllowAnnotations(value)
Enables or disables the ‘annotations’ restriction in the PDF document.
The default value is false.
1594 1595 1596 |
# File 'PDFreactor.rb', line 1594 def setAllowAnnotations(value) @config.in1["allowAnnotations"] = value end |
- setAllowAssembly(value)
Enables or disables the ‘assembly’ restriction in the PDF document.
The default value is false.
1604 1605 1606 |
# File 'PDFreactor.rb', line 1604 def setAllowAssembly(value) @config.in1["allowAssembly"] = value end |
- setAllowCopy(value)
Enables or disables the ‘copy’ restriction in the PDF document.
The default value is false.
1614 1615 1616 |
# File 'PDFreactor.rb', line 1614 def setAllowCopy(value) @config.in1["allowCopy"] = value end |
- setAllowDegradedPrinting(value)
Enables or disables the ‘degraded printing’ restriction in the PDF document.
The default value is false.
1625 1626 1627 |
# File 'PDFreactor.rb', line 1625 def setAllowDegradedPrinting(value) @config.in1["allowDegradedPrinting"] = value end |
- setAllowFillIn(value)
Enables or disables the ‘fill in’ restriction in the PDF document.
The default value is false.
1635 1636 1637 |
# File 'PDFreactor.rb', line 1635 def setAllowFillIn(value) @config.in1["allowFillIn"] = value end |
- setAllowModifyContents(value)
Enables or disables the ‘modify contents’ restriction in the PDF document.
The default value is false.
1646 1647 1648 |
# File 'PDFreactor.rb', line 1646 def setAllowModifyContents(value) @config.in1["allowModifyContents"] = value end |
- setAllowPrinting(value)
Enables or disables the ‘printing’ restriction in the PDF document.
The default value is false.
1656 1657 1658 |
# File 'PDFreactor.rb', line 1656 def setAllowPrinting(value) @config.in1["allowPrinting"] = value end |
- setAllowScreenReaders(value)
Enables or disables the ‘screen readers’ restriction in the PDF document.
The default value is false.
1667 1668 1669 |
# File 'PDFreactor.rb', line 1667 def setAllowScreenReaders(value) @config.in1["allowScreenReaders"] = value end |
- setAppendLog(value)
Specifies whether or not the log data should be added to the PDF document.
The default value is false.
1584 1585 1586 |
# File 'PDFreactor.rb', line 1584 def setAppendLog(value) @config.in1["appendLog"] = value end |
- setAuthenticationCredentials(authenticationUsername, authenticationPassword)
Enables access to resources that are secured via Basic or Digest authentication.
1460 1461 1462 1463 |
# File 'PDFreactor.rb', line 1460 def setAuthenticationCredentials(authenticationUsername, authenticationPassword) @config.in1["authenticationUsername"] = authenticationUsername @config.in1["authenticationPassword"] = authenticationPassword end |
- setAuthor(value)
Sets the value of the author field of the PDF document.
1328 1329 1330 |
# File 'PDFreactor.rb', line 1328 def setAuthor(value) @config.in1["author"] = value end |
- setBaseURL(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 specifyanother reference URL. If this URL is not nil then it will be used instead of the system id.
The default value is nil.
1070 1071 1072 |
# File 'PDFreactor.rb', line 1070 def setBaseURL(value) @config.in1["baseURL"] = value end |
- setBookletMode(sheetSize, sheetMargin, rtl)
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
1924 1925 1926 1927 1928 1929 |
# File 'PDFreactor.rb', line 1924 def setBookletMode(sheetSize, sheetMargin, rtl) @config.in1["bookletSheetSize"] = sheetSize; @config.in1["bookletRTL"] = rtl; @config.in1["bookletSheetMargin"] = sheetMargin; @config.in1["bookletModeEnabled"] = true end |
- setCacheFonts(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 for more information).
The default value is true.
954 955 956 |
# File 'PDFreactor.rb', line 954 def setCacheFonts(value) @config.in1["cacheFonts"] = value end |
- setCleanupTool(value)
Sets the cleanup tool to use for documents with unparsable content.
Use one of the following CLEANUP_ constants to specify the cleanup tool:
The default value is CLEANUP_CYBERNEKO.
The cleanup tool is only used for DOCTYPE_XHTML. HTML5 utilizes an internal cleanup.
1115 1116 1117 |
# File 'PDFreactor.rb', line 1115 def setCleanupTool(value) @config.in1["cleanupTool"] = value end |
- setConformance(conformance)
Sets the conformance of the PDF.
The default value is CONFORMANCE_PDF
1774 1775 1776 |
# File 'PDFreactor.rb', line 1774 def setConformance(conformance) @config.in1["conformance"] = conformance end |
- setContinuousOutput(width, height)
Enables the conversion of the input document into one image.
2087 2088 2089 2090 |
# File 'PDFreactor.rb', line 2087 def setContinuousOutput(width,height) @config.in1["continuousWidth"] = width; @config.in1["continuousHeight"] = height end |
- setCookie(key, value)
Adds a cookie to all outgoing HTTP connections. Parameters are URL encoded. If the key already exists, the pair is overwritten.
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'PDFreactor.rb', line 1491 def setCookie(key, value) = [] << key << value if @config.in1["cookies"] == nil @config.in1["cookies"] = [] end @config.in1["cookies"] << end |
- setCreator(value)
Sets the value of creator field of the PDF document.
1335 1336 1337 |
# File 'PDFreactor.rb', line 1335 def setCreator(value) @config.in1["creator"] = value end |
- setDefaultColorSpace(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 is COLOR_SPACE_RGB.
1789 1790 1791 |
# File 'PDFreactor.rb', line 1789 def setDefaultColorSpace(defaultColorSpace) @config.in1["defaultColorSpace"] = defaultColorSpace end |
- setDisableFontEmbedding(disableFontEmbedding)
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.
1828 1829 1830 |
# File 'PDFreactor.rb', line 1828 def setDisableFontEmbedding(disableFontEmbedding) @config.in1["disableFontEmbedding"] = disableFontEmbedding end |
- setDisableFontRegistration(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.
882 883 884 |
# File 'PDFreactor.rb', line 882 def setDisableFontRegistration(value) @config.in1["disableFontRegistration"] = value end |
- setDisableSystemFonts(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.
898 899 900 |
# File 'PDFreactor.rb', line 898 def setDisableSystemFonts(value) @config.in1["disableSystemFonts"] = value end |
- setDocumentDefaultLanguage(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.
1177 1178 1179 |
# File 'PDFreactor.rb', line 1177 def setDocumentDefaultLanguage(languageCode) @config.in1["documentDefaultLanguage"] = languageCode end |
- setDocumentType(value)
Sets the document type.
Use one of the following DOCTYPE_ constants to specify the document type:
The default value is link DOCTYPE_AUTODETECT.
1168 1169 1170 |
# File 'PDFreactor.rb', line 1168 def setDocumentType(value) @config.in1["documentType"] = value end |
- setEncoding(value)
Sets the encoding of the document.
If this value is set to nil or it is empty then the encoding will be detected automatically.
The default value is nil.
1094 1095 1096 |
# File 'PDFreactor.rb', line 1094 def setEncoding(value) @config.in1["encoding"] = value end |
- setEncryption(value)
Sets the encryption.
Use one of the following ENCRYPTION_ constants to specify the encryption:
The default value is ENCRYPTION_NONE.
1417 1418 1419 |
# File 'PDFreactor.rb', line 1417 def setEncryption(value) @config.in1["encryption"] = value end |
- setFontCachePath(value)
Sets the path of the font cache.
This path will be used to read and write the font cache. If the font cache path is set to nil then the "user.home" directory will be used.
The default value is nil.
969 970 971 |
# File 'PDFreactor.rb', line 969 def setFontCachePath(value) @config.in1["fontCachePath"] = value end |
- setFontDirectory(value)
since PDFreactor 6. Use #addFontDirectory instead.
974 975 976 |
# File 'PDFreactor.rb', line 974 def setFontDirectory(value) @config.in1["fontDirectory"] = value end |
- setFontFallback(fontArray)
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.
1838 1839 1840 |
# File 'PDFreactor.rb', line 1838 def setFontFallback(fontArray) @config.in1["fontFallback"] = fontArray end |
- setFullCompression(value)
Enables or disables full compression of the PDF document.
The default value is false.
1426 1427 1428 |
# File 'PDFreactor.rb', line 1426 def setFullCompression(value) @config.in1["fullCompression"] = value end |
- setHTTPSMode(value)
Sets the HTTPS Mode.
In closed environment lenient can be the preferred setting to avoid HTTPS issues that are not security critical.
The default value is link HTTPS_MODE_STRICT.
1149 1150 1151 |
# File 'PDFreactor.rb', line 1149 def setHTTPSMode(value) @config.in1["httpsMode"] = value end |
- setJavaScriptMode(value)
Sets the JavaScript Mode.
JAVASCRIPT_MODE_ENABLED_NO_LAYOUT
JAVASCRIPT_MODE_ENABLED_REAL_TIME
JAVASCRIPT_MODE_ENABLED_TIME_LAPSE
The default value is link JAVASCRIPT_MODE_DISABLED.
1134 1135 1136 |
# File 'PDFreactor.rb', line 1134 def setJavaScriptMode(value) @config.in1["javaScriptMode"] = value end |
- setKeywords(value)
Sets the value of the keywords field of the PDF document.
1342 1343 1344 |
# File 'PDFreactor.rb', line 1342 def setKeywords(value) @config.in1["keywords"] = value end |
- setLicenseKey(content)
Sets the license key using a string.
If no license key could be found then PDFreactor runs in evaluation mode.
The default value is nil.
865 866 867 |
# File 'PDFreactor.rb', line 865 def setLicenseKey(content) @config.in1["licenseKey"] = content end |
- setLogExceedingContent(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.
EXCEEDING_CONTENT_ANALYZE_NONE
EXCEEDING_CONTENT_ANALYZE_CONTENT
EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES
EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES
The default value is EXCEEDING_CONTENT_ANALYZE_NONE.
Use EXCEEDING_CONTENT_AGAINST_ constants to specify that exceeding this content starts exceeding content logging.
EXCEEDING_CONTENT_AGAINST_NONE
EXCEEDING_CONTENT_AGAINST_PARENT
EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT
EXCEEDING_CONTENT_AGAINST_PAGE_BORDERS
The default value is EXCEEDING_CONTENT_AGAINST_NONE.
1043 1044 1045 1046 |
# File 'PDFreactor.rb', line 1043 def setLogExceedingContent(logExceedingContentAnalyze, logExceedingContentAgainst) @config.in1["logExceedingContentAnalyze"] = logExceedingContentAnalyze @config.in1["logExceedingContentAgainst"] = logExceedingContentAgainst end |
- setLogLevel(value)
Sets the log level.
Use one of the following LOG_LEVEL_ constants to specify the log level:
The default value is LOG_LEVEL_NONE.
1009 1010 1011 |
# File 'PDFreactor.rb', line 1009 def setLogLevel(value) @config.in1["logLevel"] = value end |
- setMergeBeforePDF(mergeXMLBeforePDF)
since PDFreactor 5. Use #setMergeMode instead.
1990 1991 1992 1993 1994 1995 1996 |
# File 'PDFreactor.rb', line 1990 def setMergeBeforePDF(mergeXMLBeforePDF) if mergeXMLBeforePDF setMergeMode(MERGE_MODE_PREPEND) else setMergeMode(MERGE_MODE_APPEND) end end |
- setMergeByteArray(byteArray)
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 nil
1971 1972 1973 |
# File 'PDFreactor.rb', line 1971 def setMergeByteArray(byteArray) @config.in1["mergeByteArray"] = byteArray end |
- setMergeByteArrays(byteArrays)
This method sets an array of byte arrays that contain multiple external PDFs which will be merged with the PDF document generated by the XML source.
The default value is nil
1985 1986 1987 |
# File 'PDFreactor.rb', line 1985 def setMergeByteArrays(byteArrays) @config.in1["mergeByteArrays"] = byteArrays end |
- setMergeMode(mergeMode)
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.
2010 2011 2012 |
# File 'PDFreactor.rb', line 2010 def setMergeMode(mergeMode) @config.in1["mergeMode"] = mergeMode end |
- setMergeURL(url)
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 nil
1945 1946 1947 |
# File 'PDFreactor.rb', line 1945 def setMergeURL(url) @config.in1["mergeURL"] = url end |
- setMergeURLs(urlArray)
This method sets an array of URLs of external PDF documents which will be merged with the PDF document generated by the XML source.
1957 1958 1959 |
# File 'PDFreactor.rb', line 1957 def setMergeURLs(urlArray) @config.in1["mergeURLs"] = urlArray end |
- setOutputFormat(format, width, height)
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.
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
1203 1204 1205 1206 1207 |
# File 'PDFreactor.rb', line 1203 def setOutputFormat(format, width, height) @config.in1["outputFormat"] = format @config.in1["outputWidth"] = width @config.in1["outputHeight"] = height end |
- setOutputIntentFromByteArray(identifier, profileData)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF
1809 1810 1811 1812 1813 |
# File 'PDFreactor.rb', line 1809 def setOutputIntentFromByteArray(identifier, profileData) @config.in1["outputIntentIdentifier"] = identifier @config.in1["outputIntentICCProfileData"] = profileData @config.in1["outputIntentICCProfileURL"] = nil end |
- setOutputIntentFromURL(identifier, profileUrl)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
1798 1799 1800 1801 1802 |
# File 'PDFreactor.rb', line 1798 def setOutputIntentFromURL(identifier, profileUrl) @config.in1["outputIntentIdentifier"] = identifier @config.in1["outputIntentICCProfileURL"] = profileUrl @config.in1["outputIntentICCProfileData"] = nil end |
- setOverlayRepeat(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 OVERLAY_REPEAT_ constants to specify the overlay repeat.
The default value is OVERLAY_REPEAT_NONE.
2030 2031 2032 |
# File 'PDFreactor.rb', line 2030 def setOverlayRepeat() @config.in1["overlayRepeat"] = end |
- setOwnerPassword(value)
Sets the owner password of the PDF document.
The default value is nil
1437 1438 1439 |
# File 'PDFreactor.rb', line 1437 def setOwnerPassword(value) @config.in1["ownerPassword"] = value end |
- setPageOrder(order)
Sets the page order of the direct result of the conversion.
1877 1878 1879 |
# File 'PDFreactor.rb', line 1877 def setPageOrder(order) @config.in1["pageOrder"] = order end |
- setPagesPerSheetProperties(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.
PAGES_PER_SHEET_DIRECTION_DOWN_LEFT
PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT
PAGES_PER_SHEET_DIRECTION_LEFT_DOWN
PAGES_PER_SHEET_DIRECTION_LEFT_UP
PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN
PAGES_PER_SHEET_DIRECTION_RIGHT_UP
1909 1910 1911 1912 1913 1914 1915 1916 |
# File 'PDFreactor.rb', line 1909 def setPagesPerSheetProperties(cols, rows, sheetSize, sheetMargin, spacing, direction) @config.in1["pagesPerSheetCols"] = cols @config.in1["pagesPerSheetRows"] = rows @config.in1["pagesPerSheetSheetSize"] = sheetSize @config.in1["pagesPerSheetSheetMargin"] = sheetMargin @config.in1["pagesPerSheetSpacing"] = spacing @config.in1["pagesPerSheetDirection"] = direction end |
- setPixelsPerInch(ppi)
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.
1849 1850 1851 |
# File 'PDFreactor.rb', line 1849 def setPixelsPerInch(ppi) @config.in1["pixelsPerInch"] = ppi end |
- setPixelsPerInchShrinkToFit(pixelsPerInchShrinkToFit)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages.
1857 1858 1859 |
# File 'PDFreactor.rb', line 1857 def setPixelsPerInchShrinkToFit(pixelsPerInchShrinkToFit) @config.in1["pixelsPerInchShrinkToFit"] = pixelsPerInchShrinkToFit end |
- setPostTransformationDocumentType(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’.
1223 1224 1225 |
# File 'PDFreactor.rb', line 1223 def setPostTransformationDocumentType(value) @config.in1["postTransformationDocumentType"] = value end |
- setPrintDialogPrompt(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.
1574 1575 1576 |
# File 'PDFreactor.rb', line 1574 def setPrintDialogPrompt(value) @config.in1["printDialogPrompt"] = value end |
- setProcessingPreferences(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.
1684 1685 1686 |
# File 'PDFreactor.rb', line 1684 def setProcessingPreferences(processingPreferences) @config.in1["processingPreferences"] = processingPreferences end |
- setRequestHeader(key, value)
Adds a request header to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 |
# File 'PDFreactor.rb', line 1474 def setRequestHeader(key, value) requestheaderarray = [] requestheaderarray << key requestheaderarray << value if @config.in1["requestHeaderMap"] == nil @config.in1["requestHeaderMap"] = [] end @config.in1["requestHeaderMap"] << requestheaderarray end |
- setSignPDF(keystoreURL, keyAlias, keystorePassword, keystoreType, signingMode)
Sets a digital certificate to sign the newly created PDF.
Requires a keystore file. The included certificate may be self-signed.
Use the KEYSTORE_TYPE_ constants to specify the keystore type.
Use the SIGNING_MODE_ constants to specify the signing mode.
2061 2062 2063 2064 2065 2066 2067 |
# File 'PDFreactor.rb', line 2061 def setSignPDF(keystoreURL, keyAlias, keystorePassword, keystoreType, signingMode) @config.in1["signPdfKeystoreURL"] = keystoreURL; @config.in1["signPdfKeyAlias"] = keyAlias; @config.in1["signPdfKeystorePassword"] = keystorePassword; @config.in1["signPdfKeystoreType"] = keystoreType; @config.in1["signPdfSigningMode"] = signingMode end |
- setSubject(value)
Sets the value of the subject field of the PDF document.
1356 1357 1358 |
# File 'PDFreactor.rb', line 1356 def setSubject(value) @config.in1["subject"] = value end |
- setThrowLicenseExceptions(throwLicenseExceptions)
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.
1052 1053 1054 |
# File 'PDFreactor.rb', line 1052 def setThrowLicenseExceptions(throwLicenseExceptions) @config.in1["throwLicenseExceptions"] = throwLicenseExceptions end |
- setTitle(value)
Sets the value of the title field of the PDF document.
1349 1350 1351 |
# File 'PDFreactor.rb', line 1349 def setTitle(value) @config.in1["title"] = value end |
- setUserPassword(value)
Sets the user password of the PDF document.
The default value is nil.
1448 1449 1450 |
# File 'PDFreactor.rb', line 1448 def setUserPassword(value) @config.in1["userPassword"] = value end |
- setViewerPreferences(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.
VIEWER_PREFERENCES_CENTER_WINDOW
VIEWER_PREFERENCES_DIRECTION_L2R
VIEWER_PREFERENCES_DIRECTION_R2L
VIEWER_PREFERENCES_DISPLAY_DOC_TITLE
VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE
VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE
VIEWER_PREFERENCES_DUPLEX_SIMPLEX
VIEWER_PREFERENCES_HIDE_MENUBAR
VIEWER_PREFERENCES_HIDE_TOOLBAR
VIEWER_PREFERENCES_HIDE_WINDOW_UI
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS
VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN
VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT
VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN
VIEWER_PREFERENCES_PAGE_MODE_USE_NONE
VIEWER_PREFERENCES_PAGE_MODE_USE_OC
VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES
VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS
VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE
VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE
1759 1760 1761 |
# File 'PDFreactor.rb', line 1759 def setViewerPreferences(viewerPreferences) @config.in1["viewerPreferences"] = viewerPreferences end |
- setXSLTMode(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.
1082 1083 1084 |
# File 'PDFreactor.rb', line 1082 def setXSLTMode(value) @config.in1["XSLTMode"] = value end |