Class: PDFreactor

Inherits:
Object
  • Object
show all
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)

Constructor Details

- (PDFreactor) initialize(host = "localhost", port = 9423)

Constructor

Parameters:

  • (string) host (defaults to: "localhost")

    The optional host.

  • (int) port (defaults to: 9423)

    The optional port.



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.

Parameters:

  • (binary) data

    The binary content of the attachment. May be nil.

  • (string) url

    If data is nil, the attachment will be retrieved from this URL. If this is "#" the input document URL is used instead.

  • (string) name

    The file name associated with the attachment. It is recommended to specify the correct file extension. If this is nil the name is derived from the URL.

  • (string) description

    The description of the attachment. If this is nil the name is used.



1384
1385
1386
1387
1388
1389
1390
1391
1392
# File 'PDFreactor.rb', line 1384

def addAttachment(data, url, name, description)
  attachment = { "url" => url, "data" => data, "name" => name, "description" => description }
  
  if @config.in1["attachments"] == nil
    @config.in1["attachments"] = []
  end
  
  @config.in1["attachments"] << attachment
end

- addCustomDocumentProperty(name, value)

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

Parameters:

  • (string) name

    The key of the property.

  • (string) value

    The value of the property.



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".

Parameters:

  • (string) source

    The URL to load the font from.

  • (string) family

    The font family name the loaded font will be labeled as.

  • (boolean) bold

    Whether the font will be labeled bold.

  • (boolean) italic

    Whether the font will be labeled italic."""



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.

Parameters:

  • (string) source

    The name of an existing font family.

  • (string) family

    The alias name for that font.

  • (boolean) bold

    Whether the alias will be labeled bold.

  • (boolean) italic

    Whether the alias will be labeled italic."""



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.

Parameters:

  • (string) The

    path of the font directory.



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:

  1. Specifying the script only by an URI.
  2. Specifying the script by the content of the script and

alternatively setting a URI to resolve relative elements. If no URI is specified then the system id/base URL of the document will be used.

Parameters:

  • (string) content

    The content of the script.

  • (string) URI

    The URI of the script.

  • (boolean) beforeDocumentScripts

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

See Also:



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:

  1. Specifying the stylesheet only using an URI.
  2. 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.

Parameters:

  • (string) content

    The content of the style sheet.

  • (string) media

    The media type of the style sheet.

  • (string) title

    The title of the stylesheet.

  • (string) uri

    The URI of the style sheet.

See Also:



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:

  1. Specifying the stylesheet only using an URI.
  2. 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.

Parameters:

  • (string) content

    The content of the style sheet.

  • (string) uri

    The URI of the style sheet.

See Also:



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.

Returns:

  • (string)

    The message string.



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.

Returns:

  • (array)

    Array of ExceedingContent objects or nil if the logging of exceeding content was not enabled or no conversion was run, yet.



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.

Returns:

  • (string)

    The log string.

See Also:



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.

Parameters:

  • (boolean) pdf

    If true, return the number of pages of the resulting PDF (including, e.g. merge operations),

See Also:



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.

See Also:

  • string, boolean)


1317
1318
1319
# File 'PDFreactor.rb', line 1317

def removeAllUserScripts()
  @config.in1["userScripts"] = nil
end

- removeAllUserStyleSheets

Removes all user style sheets.

See Also:



1255
1256
1257
# File 'PDFreactor.rb', line 1255

def removeAllUserStyleSheets
  @config.in1["userStyleSheets"] = nil
end

- removeAllXSLTStyleSheets

Removes all XSLT style sheets.

See Also:



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.

Parameters:

  • (binary) byteArray

    A binary string containing the content of the XML document.

Returns:

  • (binary)

    The PDF document as a binary string.

See Also:



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.

Parameters:

  • (array) byteArray

    An array containing the content of the HTML or XML document.

Returns:

  • (array)

    An array of byte-arrays each containing an image representing one page of the document.

See Also:



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.

Parameters:

  • (string) content

    A string containing the content of the XML document.

Returns:

  • (binary)

    The PDF document as a binary string.

See Also:



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.

Parameters:

  • (string) content

    A String containing the content of the HTML or XML document.

Returns:

  • (array)

    An array of byte-arrays each containing an image representing one page of the document.

See Also:



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.

Parameters:

  • (string) url

    A URL pointing to the XML document.

Returns:

  • (binary)

    The PDF document as a binary string.

See Also:



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.

Parameters:

  • (string) url

    A URL pointing to the input document.

Returns:

  • (array)

    An array of byte-arrays each containing an image representing one page of the document.

See Also:



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.

Parameters:

  • (boolean) value

    Whether to enable CSS based attachments.



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.

Parameters:

  • (boolean) value

    Use true to enable bookmarks in the document and false to disable bookmarks.



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.

Parameters:

  • (boolean) value

    Use true to enable comments in the PDF document and false to disable comments.



1539
1540
1541
# File 'PDFreactor.rb', line 1539

def setAddComments(value)
  @config.in1["addComments"] = value
end

Enables or disables links in the PDF document.

The default value is false.

Parameters:

  • (boolean) value

    Use true to enable links in the document and false to disable links.



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.

Parameters:

  • (boolean) value

    Whether to enable overprinting.



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.

Parameters:

  • (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.



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.

Parameters:

  • (boolean) value

    Use true to enable tagging of the document and false to disable tagging.



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.

Parameters:

  • (boolean) value

    Use true to enable ‘annotations’ in the document and false to disable ‘annotations’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘assembly’ in the document and false to disable ‘assembly’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘copy’ in the document and false to disable ‘copy’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘degraded printing’ in the document and false to disable ‘degraded printing’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘fill in’ in the document and false to disable ‘fill in’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘modify contents’ in the document and false to disable ‘modify contents’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘printing’ in the document and false to disable ‘printing’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to enable ‘screen readers’ in the document and false to disable ‘screen readers’.

See Also:



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.

Parameters:

  • (boolean) value

    Use true to add the log data to the document and false if the log data should not be added.



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.

Parameters:

  • (string) username

    The user name for the secured realm.

  • (string) password

    The password for the secured realm.



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.

Parameters:

  • (string) value

    The author of the 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.

Parameters:

  • (string) value

    The base URL for the document.



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.

Parameters:

  • (string) sheetSize

    The size of the sheet as CSS value, e.g. A3, letter landscape, 15in 20in, 20cm 30cm.

  • (string) sheetMargin

    The sheet margin as CSS margin, e.g. 1in, 1cm 1.5cm, 10mm 20mm 10mm 30mm. nil is interpreted as 0mm.

  • (boolean) rtl

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



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.

Parameters:

  • (boolean) value

    The new value of the cache fonts setting.

See Also:



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:

CLEANUP_NONE

CLEANUP_JTIDY

CLEANUP_CYBERNEKO

CLEANUP_TAGSOUP

The default value is CLEANUP_CYBERNEKO.

The cleanup tool is only used for DOCTYPE_XHTML. HTML5 utilizes an internal cleanup.

Parameters:

  • (int) value

    The new cleanup tool.



1115
1116
1117
# File 'PDFreactor.rb', line 1115

def setCleanupTool(value)
  @config.in1["cleanupTool"] = value
end

- setConformance(conformance)

Sets the conformance of the PDF.

CONFORMANCE_PDF

CONFORMANCE_PDFA1A

CONFORMANCE_PDFA3A

The default value is CONFORMANCE_PDF

Parameters:

  • (int) conformance

    conformance constants.



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.

Parameters:

  • (int) width

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

  • (int) height

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



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.

Parameters:

  • (string) key

    The key of the cookie.

  • (string) value

    The value of the cookie.



1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
# File 'PDFreactor.rb', line 1491

def setCookie(key, value)
  cookiearray = []
  cookiearray << key
  cookiearray << value
  
  if @config.in1["cookies"] == nil
    @config.in1["cookies"] = []
  end
  
  @config.in1["cookies"] << cookiearray
end

- setCreator(value)

Sets the value of creator field of the PDF document.

Parameters:

  • (string) value

    The creator of the 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.

COLOR_SPACE_CMYK

COLOR_SPACE_RGB

The default value is COLOR_SPACE_RGB.

Parameters:

  • (int) defaultColorSpace

    The default color space of the PDF



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.

Parameters:

  • (boolean) disableFontEmbedding

    Enable or disable font embedding.



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.

Parameters:

  • (boolean) value

    The new value of the font registration setting.

See Also:



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.

Parameters:

  • (boolean) value

    The new value of the font registration setting.

See Also:



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.

Parameters:

  • (string) languageCode

    the default ISO 639 language code used for documents.



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:

DOCTYPE_AUTODETECT

DOCTYPE_XML

DOCTYPE_XHTML

DOCTYPE_HTML5

The default value is link DOCTYPE_AUTODETECT.

Parameters:

  • (int) value

    The new document type setting.



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.

Parameters:

  • (string) value

    The encoding of the document or nil for autodetection.



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:

ENCRYPTION_NONE

ENCRYPTION_40

ENCRYPTION_128

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.

Parameters:

  • (string) location

    The path of the font cache.

See Also:



969
970
971
# File 'PDFreactor.rb', line 969

def setFontCachePath(value)
  @config.in1["fontCachePath"] = value
end

- setFontDirectory(value)

Deprecated.

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.

Parameters:

  • (array) fontFallback

    an array of font family names



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.

Parameters:

  • (boolean) value

    true to enable full compression of the document and false to disable full compression.



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.

HTTPS_MODE_STRICT

HTTPS_MODE_LENIENT

The default value is link HTTPS_MODE_STRICT.

Parameters:

  • (int) httpsMode

    The HTTPS mode.



1149
1150
1151
# File 'PDFreactor.rb', line 1149

def setHTTPSMode(value)
  @config.in1["httpsMode"] = value
end

- setJavaScriptMode(value)

Parameters:

  • (int) javaScriptMode

    The JavaScript mode.



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.

Parameters:

  • (string) value

    The keywords of the 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.

Parameters:

  • (string) content

    The content of the license key as a string.



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.

Parameters:

  • (int) logExceedingContentAnalyze

    Enables logging of exceeding content and optionally of boxes.

  • (int) logExceedingContentAgainst

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



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:

LOG_LEVEL_NONE

LOG_LEVEL_FATAL

LOG_LEVEL_WARN

LOG_LEVEL_INFO

LOG_LEVEL_DEBUG

LOG_LEVEL_PERFORMANCE

The default value is LOG_LEVEL_NONE.

Parameters:

  • (int) value

    The new log level setting.

See Also:



1009
1010
1011
# File 'PDFreactor.rb', line 1009

def setLogLevel(value)
  @config.in1["logLevel"] = value
end

- setMergeBeforePDF(mergeXMLBeforePDF)

Deprecated.

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

Parameters:

  • (binary) A

    binary string containing the PDF RAW data.

See Also:



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

Parameters:

  • (array) byteArrays

    An array of binary strings containing the PDF RAW data.

See Also:



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:

The default value is MERGE_MODE_APPEND.

Parameters:

  • (int) mergeMode

    The merge mode.



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

Parameters:

  • (string) url

    A URL of a PDF document.

See Also:



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.

Parameters:

  • (array) urlArray

    An array of URL strings.

See Also:



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

Parameters:

  • (int) format

    the output format. See ‘OUTPUT_FORMAT_’ constants

  • (int) 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.

  • (int) 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.



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

Parameters:

  • (string) identifier

    The OutputConditionIdentifier

  • (string) profileData

    The DestOutputProfile



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.

Parameters:

  • (string) identifier

    The OutputConditionIdentifier

  • (string) profileUrl

    The DestOutputProfile



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.

OVERLAY_REPEAT_NONE

OVERLAY_REPEAT_LAST_PAGE

OVERLAY_REPEAT_ALL_PAGES

The default value is OVERLAY_REPEAT_NONE.

Parameters:

  • (int) overlayRepeat

    The overlay repeat mode.



2030
2031
2032
# File 'PDFreactor.rb', line 2030

def setOverlayRepeat(overlayRepeat)
  @config.in1["overlayRepeat"] = overlayRepeat
end

- setOwnerPassword(value)

Sets the owner password of the PDF document.

The default value is nil

Parameters:

  • (string) value

    The owner password.

See Also:



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.

PAGE_ORDER_EVEN

PAGE_ORDER_ODD

PAGE_ORDER_BOOKLET

PAGE_ORDER_BOOKLET_RTL

Parameters:

  • (string) order

    A comma-separated list of page numbers and ranges is intended as parameter. Alternatively, PAGE_ORDER_ constants can be used.



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

PAGES_PER_SHEET_DIRECTION_UP_LEFT

PAGES_PER_SHEET_DIRECTION_UP_RIGHT

Parameters:

  • (int) cols

    The number of columns per sheet.

  • (int) rows

    The number of rows per sheet.

  • (string) sheetSize

    The sheet size as CSS size, e.g. A4, letter landscape, 15in 20in, 20cm 30cm.

  • (string) sheetMargin

    The sheet margin as CSS margin, e.g. 1in, 1cm 1.5cm, 10mm 20mm 10mm 30mm. nil is interpreted as 0mm.

  • (string) spacing

    The horizontal and vertical space between pages on a sheet as CSS value, e.g. 0.1in, 5mm 2mm. nil is interpreted as 0mm.

  • (int) direction

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



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.

Parameters:

  • (int) ppi

    The pixels per inch.



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.

Parameters:

  • (boolean) pixelsPerInchShrinkToFit


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’.

DOCTYPE_AUTODETECT

DOCTYPE_XML

DOCTYPE_XHTML

DOCTYPE_HTML5

Parameters:

  • (integer) The

    new document type setting.



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.

Parameters:

  • (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.



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.

PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES

Parameters:

  • (int) processingPreferences

    A value of ORed processing preferences flags



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.

Parameters:

  • (string) key

    The key of the header.

  • (string) value

    The value of the header.



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.

KEYSTORE_TYPE_JKS

KEYSTORE_TYPE_PKCS12

Use the SIGNING_MODE_ constants to specify the signing mode.

SIGNING_MODE_SELF_SIGNED

SIGNING_MODE_VERISIGN_SIGNED

SIGNING_MODE_WINCER_SIGNED

Parameters:

  • (string) keystoreURL

    The URL to the keystore file.

  • (string) keyAlias

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

  • (string) keystorePassword

    The password of the keystore.

  • (string) keystoreType

    The format of the keystore, i.e. pkcs12 or jks.

  • (int) signingMode

    The mode that is used to sign the PDF, i.e. self-signed, Windows certificate or VeriSign.



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.

Parameters:

  • (string) value

    The subject of the 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.

Parameters:

  • (string) value

    The title of the 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.

Parameters:

  • (string) value

    The user password.

See Also:



1448
1449
1450
# File 'PDFreactor.rb', line 1448

def setUserPassword(value)
  @config.in1["userPassword"] = value
end

- setViewerPreferences(viewerPreferences)

Parameters:

  • (int) viewerPreferences

    ORed VIEWER_PREFERENCES_ constants.



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.

Parameters:

  • (boolean) value

    The new XSLT mode.



1082
1083
1084
# File 'PDFreactor.rb', line 1082

def setXSLTMode(value)
  @config.in1["XSLTMode"] = value
end