|
PDFreactor API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.realobjects.pdfreactor.PDFreactor
PDFreactor converts XML/XHTML documents into PDF and provides
a large number of settings for the conversion process.
This sample demonstrates the use of PDFreactor:
PDFreactor pdfReactor = new PDFreactor();
FileOutputStream outputStream = new FileOutputStream("realobjects.pdf");
pdfReactor.setAddBookmarks(true);
pdfReactor.setAddLinks(true);
byte[] pdf = pdfReactor.renderDocumentFromURL("http://www.realobjects.com/");
outputStream.write(pdf);
outputStream.close();
Please note: A new instance of PDFreactor should be created for every conversion.
For more information please have a look at the PDFreactor manual.
| Field Summary | |
static int |
CLEANUP_CYBERNEKO
Indicates that the CyberNeko HTML parser will be used to perform a cleanup when loading a non-well-formed document. |
static int |
CLEANUP_JTIDY
Indicates that JTidy will be used to perform a cleanup when loading a non-well-formed document. |
static int |
CLEANUP_NONE
Indicates that no cleanup will be performed when loading a document. |
static int |
CLEANUP_TAGSOUP
Indicates that tagsoup will be used to perform a cleanup when loading a non-well-formed document. |
static int |
COLOR_SPACE_CMYK
The color space CMYK |
static int |
COLOR_SPACE_RGB
The color space RGB |
static int |
CONFORMANCE_PDF
PDF with no additional restrictions (default) |
static int |
CONFORMANCE_PDFA
PDF/A-1a (ISO 19005-1 Level A) |
static int |
DOCTYPE_AUTODETECT
Indicates that the document type will be detected automatically. |
static int |
DOCTYPE_XHTML
Indicates that the document type will be set to XHTML. |
static int |
DOCTYPE_XML
Indicates that the document type will be set to generic XML. |
static int |
ENCRYPTION_128
Indicates that the document will be encrypted using RC4 128 bit encryption. |
static int |
ENCRYPTION_40
Indicates that the document will be encrypted using RC4 40 bit encryption. |
static int |
ENCRYPTION_NONE
Indicates that the document will not be encrypted. |
static int |
EXCEEDING_CONTENT_AGAINST_NONE
Do not log exceeding content |
static int |
EXCEEDING_CONTENT_AGAINST_PAGE_BORDERS
Log content exceeding the edges of its page |
static int |
EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT
Log content exceeding its page content area (overlaps the page margin) |
static int |
EXCEEDING_CONTENT_AGAINST_PARENT
Log content exceeding its container |
static int |
EXCEEDING_CONTENT_ANALYZE_CONTENT
Log exceeding content |
static int |
EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES
Log exceeding content and all boxes |
static int |
EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES
Log exceeding content and boxes without absolute positioning |
static int |
EXCEEDING_CONTENT_ANALYZE_NONE
Do not log exceeding content |
static String |
KEYSTORE_TYPE_JKS
Keystore type "jks" |
static String |
KEYSTORE_TYPE_PKCS12
Keystore type "pkcs12" |
static int |
LOG_LEVEL_DEBUG
Indicates that debug, info, warn and fatal log events will be logged. |
static int |
LOG_LEVEL_FATAL
Indicates that only fatal log events will be logged. |
static int |
LOG_LEVEL_INFO
Indicates that info, warn and fatal log events will be logged. |
static int |
LOG_LEVEL_NONE
Indicates that no log events will be logged. |
static int |
LOG_LEVEL_PERFORMANCE
Indicates that all log events will be logged. |
static int |
LOG_LEVEL_WARN
Indicates that warn and fatal log events will be logged. |
static int |
MERGE_MODE_APPEND
Default merge mode: Append converted document to existing PDF |
static int |
MERGE_MODE_OVERLAY
Alternate merge mode (overlay): Adding converted document above the existing PDF |
static int |
MERGE_MODE_OVERLAY_BELOW
Alternate merge mode (overlay): Adding converted document below the existing PDF |
static int |
MERGE_MODE_PREPEND
Alternate merge mode: Prepend converted document to existing PDF |
static int |
OVERLAY_REPEAT_ALL_PAGES
All pages of the shorter document are repeated, to overlay all pages of the longer document |
static int |
OVERLAY_REPEAT_LAST_PAGE
Last page of the shorter document is repeated, to overlay all pages of the longer document |
static int |
OVERLAY_REPEAT_NONE
No pages of the shorter document are repeated, leaving some pages of the longer document without overlay |
static String |
PAGE_ORDER_BOOKLET
Page order mode to arrange all pages in booklet order |
static String |
PAGE_ORDER_BOOKLET_RTL
Page order mode to arrange all pages in right-to-left booklet order |
static String |
PAGE_ORDER_EVEN
Page order mode to keep even pages only |
static String |
PAGE_ORDER_ODD
Page order mode to keep odd pages only |
static String |
PAGE_ORDER_REVERSE
Page order mode to reverse the page order |
static int |
PAGES_PER_SHEET_DIRECTION_DOWN_LEFT
Arranges the pages on a sheet from top to bottom and right to left |
static int |
PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT
Arranges the pages on a sheet from top to bottom and left to right |
static int |
PAGES_PER_SHEET_DIRECTION_LEFT_DOWN
Arranges the pages on a sheet from right to left and top to bottom |
static int |
PAGES_PER_SHEET_DIRECTION_LEFT_UP
Arranges the pages on a sheet from right to left and bottom to top |
static int |
PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN
Arranges the pages on a sheet from left to right and top to bottom |
static int |
PAGES_PER_SHEET_DIRECTION_RIGHT_UP
Arranges the pages on a sheet from left to right and bottom to top |
static int |
PAGES_PER_SHEET_DIRECTION_UP_LEFT
Arranges the pages on a sheet from bottom to top and right to left |
static int |
PAGES_PER_SHEET_DIRECTION_UP_RIGHT
Arranges the pages on a sheet from bottom to top and left to right |
static int |
PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES
Processing preferences flag for the memory saving mode for images |
static int |
SIGNING_MODE_SELF_SIGNED
Signing mode for self-signed certificates |
static int |
SIGNING_MODE_VERISIGN_SIGNED
Signing mode for VeriSign certificates |
static int |
SIGNING_MODE_WINCER_SIGNED
Signing mode for Windows certificates |
static int |
VIEWER_PREFERENCES_CENTER_WINDOW
Position the document's window in the center of the screen. |
static int |
VIEWER_PREFERENCES_DIRECTION_L2R
Position pages in ascending order from left to right. |
static int |
VIEWER_PREFERENCES_DIRECTION_R2L
Position pages in ascending order from right to left. |
static int |
VIEWER_PREFERENCES_DISPLAY_DOC_TITLE
Display the document's title in the top bar. |
static int |
VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE
Print dialog default setting: duplex (long edge) |
static int |
VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE
Print dialog default setting: duplex (short edge) |
static int |
VIEWER_PREFERENCES_DUPLEX_SIMPLEX
Print dialog default setting: simplex |
static int |
VIEWER_PREFERENCES_FIT_WINDOW
Resize the document's window to fit the size of the first displayed page. |
static int |
VIEWER_PREFERENCES_HIDE_MENUBAR
Hide the viewer application's menu bar when the document is active. |
static int |
VIEWER_PREFERENCES_HIDE_TOOLBAR
Hide the viewer application's tool bars when the document is active. |
static int |
VIEWER_PREFERENCES_HIDE_WINDOW_UI
Hide user interface elements in the document's window. |
static int |
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE
Show document outline panel on exiting full-screen mode. |
static int |
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC
Show attachments panel on exiting full-screen mode. |
static int |
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES
Show thumbnail images panel on exiting full-screen mode. |
static int |
VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS
Show optional content group panel on exiting full-screen mode. |
static int |
VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN
Display the pages in one column. |
static int |
VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE
Display one page at a time. |
static int |
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT
Display the pages in two columns, with odd numbered pages on the left. |
static int |
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT
Display the pages in two columns, with odd numbered pages on the right. |
static int |
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT
Display two pages at a time, with odd numbered pages on the left. |
static int |
VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT
Display two pages at a time, with odd numbered pages on the right. |
static int |
VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN
Switch to fullscreen mode on startup. |
static int |
VIEWER_PREFERENCES_PAGE_MODE_USE_ATTACHMENTS
Show attachments panel on startup. |
static int |
VIEWER_PREFERENCES_PAGE_MODE_USE_NONE
Show no panel on startup. |
static int |
VIEWER_PREFERENCES_PAGE_MODE_USE_OC
Show optional content group panel on startup. |
static int |
VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES
Show document outline panel on startup. |
static int |
VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS
Show thumbnail images panel on startup. |
static int |
VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE
Print dialog default setting: do not pick tray by PDF size |
static int |
VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE
Print dialog default setting: pick tray by PDF size |
static int |
VIEWER_PREFERENCES_PRINTSCALING_APPDEFAULT
Print dialog default setting: set scaling to application default value. |
static int |
VIEWER_PREFERENCES_PRINTSCALING_NONE
Print dialog default setting: disabled scaling |
| Constructor Summary | |
PDFreactor()
Creates an instance of PDFreactor. |
|
| Method Summary | |
void |
addProgressEventListener(ProgressEventListener listener)
Adds a ProgressEventListener. |
void |
addUserStyleSheet(InputSource inputSource)
Adds a user style sheet to the document. |
void |
addUserStyleSheet(String content,
String media,
String title,
String uri)
Adds a user style sheet to the document. |
void |
addXSLTStyleSheet(String content,
String uri)
Adds an XSLT style sheet to the document. |
String |
getError()
Returns the error messages generated during rendering. |
ExceedingContent[] |
getExceedingContents()
Provides information about content exceeding its page or parent. |
String |
getLog()
Returns the log messages generated during rendering based on the log level. |
Logger |
getLogger()
Returns the Logger used by this PDFreactor. |
int |
getNumberOfPages(boolean pdf)
Returns the number of pages of the document after conversion. |
void |
removeAllUserStyleSheets()
Removes all user style sheets. |
void |
removeAllXSLTStyleSheets()
Removes all XSLT style sheets. |
void |
removeProgressEventListener(ProgressEventListener listener)
Removes a ProgressEventListener. |
void |
renderDocument(InputSource inputSource,
OutputStream outputStream)
Generates a PDF document from an InputSource. |
byte[] |
renderDocumentFromByteArray(byte[] array)
Generates a PDF document from an XML document inside a byte array. |
byte[] |
renderDocumentFromContent(String content)
Generates a PDF document from an XML document inside a String. |
byte[] |
renderDocumentFromURL(String url)
Generates a PDF document from an XML document at a URL. |
void |
setAddBookmarks(boolean value)
Enables or disables bookmarks in the PDF document. |
void |
setAddLinks(boolean value)
Enables or disables links in the PDF document. |
void |
setAddPreviewImages(boolean value)
Enables or disables embedding of image previews per page in the PDF document. |
void |
setAddTags(boolean value)
Enables or disables tagging of the PDF document. |
void |
setAllowAnnotations(boolean value)
Enables or disables the 'annotations' restriction in the PDF document. |
void |
setAllowAssembly(boolean value)
Enables or disables the 'assembly' restriction in the PDF document. |
void |
setAllowCopy(boolean value)
Enables or disables the 'copy' restriction in the PDF document. |
void |
setAllowDegradedPrinting(boolean value)
Enables or disables the 'degraded printing' restriction in the PDF document. |
void |
setAllowFillIn(boolean value)
Enables or disables the 'fill in' restriction in the PDF document. |
void |
setAllowModifyContents(boolean value)
Enables or disables the 'modify contents' restriction in the PDF document. |
void |
setAllowPrinting(boolean value)
Enables or disables the 'printing' restriction in the PDF document. |
void |
setAllowScreenReaders(boolean value)
Enables or disables the 'screen readers' restriction in the PDF document. |
void |
setAppendLog(boolean value)
Specifies whether or not the log data should be added to the PDF document. |
void |
setAuthenticationCredentials(String username,
String password)
Enables access to resources that are secured via Basic or Digest authentication. |
void |
setAuthor(String value)
Sets the value of the author field of the PDF document. |
void |
setBaseURL(String value)
Sets the base URL of the XML document. |
void |
setBookletMode(String sheetSize,
String sheetMargin,
boolean rtl)
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet. |
void |
setCacheFonts(boolean value)
Enables or disables caching of font information. |
void |
setCleanupTool(int value)
Sets the cleanup tool to use for documents with unparsable content. |
void |
setConformance(int conformance)
Sets the conformance of the PDF. |
void |
setCookie(String key,
String value)
Adds a cookie to all outgoing HTTP connections. |
void |
setCreator(String value)
Sets the value of creator field of the PDF document. |
void |
setDefaultColorSpace(int defaultColorSpace)
Sets whether to convert color key words to CMYK instead of RGB. |
void |
setDisableFontEmbedding(boolean disableFontEmbedding)
Sets whether fonts will not be embedded into the resulting PDF. |
void |
setDisableFontRegistration(boolean value)
Enables or disables the font registration. |
void |
setDocumentDefaultLanguage(String languageCode)
Sets the language used for documents having no explicit language attribute set. |
void |
setDocumentType(int value)
Sets the document type. |
void |
setEncoding(String value)
Sets the encoding of the document. |
void |
setEncryption(int value)
Sets the encryption. |
void |
setFontCachePath(String location)
Sets the path of the font cache. |
void |
setFontDirectory(String location)
Sets the font directory from which fonts will be read. |
void |
setFontFallback(String[] fontFallback)
Sets a list of fallback font families used for character substitution. |
void |
setFullCompression(boolean value)
Enables or disables full compression of the PDF document. |
void |
setKeywords(String value)
Sets the value of the keywords field of the PDF document. |
void |
setLicenseKey(String content)
Sets the license key using a String. |
void |
setLogExceedingContent(int logExceedingContentAnalyze,
int logExceedingContentAgainst)
Whether to log content exceeding the page. |
void |
setLogger(Logger object)
Sets a Logger to receive log messages. |
void |
setLogLevel(int value)
Sets the log level. |
void |
setMergeBeforePDF(boolean value)
Deprecated. As of PDFreactor 5.0, replaced by PDFreactor.setMergeMode(int) |
void |
setMergeByteArray(byte[] array)
This method sets a byte array containing an external PDF document which will be merged with the PDF document generated by the XML source. |
void |
setMergeByteArrays(byte[][] arrays)
This method sets an array of byte arrays that contain multiple external PDFs which will be merged with the PDF document generated by the XML source. |
void |
setMergeMode(int mode)
Sets the merge mode. |
void |
setMergeURL(String url)
This method sets a URL of an external PDF document which will be merged with the PDF document generated by the XML source. |
void |
setMergeURLs(String[] urls)
This method sets an array of URLs of external PDF documents which will be merged with the PDF document generated by the XML source. |
void |
setOutputIntentFromByteArray(String identifier,
byte[] profileData)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF. |
void |
setOutputIntentFromURL(String identifier,
String profileUrl)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF. |
void |
setOverlayRepeat(int 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. |
void |
setOwnerPassword(String value)
Sets the owner password of the PDF document. |
void |
setPageOrder(String order)
Sets the page order of the direct result of the conversion. |
void |
setPagesPerSheetProperties(int cols,
int rows,
String sheetSize,
String sheetMargin,
String spacing,
int direction)
Sets the properties of a sheet on which multiple pages are being arranged. |
void |
setPixelsPerInch(int ppi)
Sets the pixels per inch. |
void |
setPixelsPerInchShrinkToFit(boolean pixelsPerInchShrinkToFit)
Whether the pixels per inch should be adapted automatically to avoid content exceeding pages. |
void |
setPrintDialogPrompt(boolean value)
Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer. |
void |
setProcessingPreferences(int processingPreferences)
Preferences that influence the conversion process without changing the output |
void |
setRequestHeader(String key,
String value)
Adds a request header to all outgoing HTTP connections. |
void |
setSignPDF(String keystoreURL,
String keyAlias,
String keystorePassword,
String keystoreType,
int signingMode)
Sets a digital certificate to sign the newly created PDF. |
void |
setSubject(String value)
Sets the value of the subject field of the PDF document. |
void |
setThrowLicenseExceptions(boolean throwLicenseExceptions)
Whether an exception should be thrown when no legal full license key is set. |
void |
setTitle(String value)
Sets the value of the title field of the PDF document. |
void |
setUserPassword(String value)
Sets the user password of the PDF document. |
void |
setViewerPreferences(int viewerPreferences)
Sets the page layout and page mode preferences of the PDF. |
void |
setXSLTMode(boolean value)
Enables or disables XSLT transformations. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int CLEANUP_NONE
PDFreactor.setCleanupTool(int),
Constant Field Valuespublic static final int CLEANUP_JTIDY
PDFreactor.setCleanupTool(int),
Constant Field Valuespublic static final int CLEANUP_CYBERNEKO
PDFreactor.setCleanupTool(int),
Constant Field Valuespublic static final int CLEANUP_TAGSOUP
PDFreactor.setCleanupTool(int),
Constant Field Valuespublic static final int DOCTYPE_AUTODETECT
PDFreactor.setDocumentType(int),
Constant Field Valuespublic static final int DOCTYPE_XML
PDFreactor.setDocumentType(int),
Constant Field Valuespublic static final int DOCTYPE_XHTML
PDFreactor.setDocumentType(int),
Constant Field Valuespublic static final int ENCRYPTION_NONE
PDFreactor.setEncryption(int),
Constant Field Valuespublic static final int ENCRYPTION_40
PDFreactor.setEncryption(int),
Constant Field Valuespublic static final int ENCRYPTION_128
PDFreactor.setEncryption(int),
Constant Field Valuespublic static final String KEYSTORE_TYPE_PKCS12
PDFreactor.setSignPDF(String, String, String, String, int),
Constant Field Valuespublic static final String KEYSTORE_TYPE_JKS
PDFreactor.setSignPDF(String, String, String, String, int),
Constant Field Valuespublic static final int SIGNING_MODE_SELF_SIGNED
PDFreactor.setSignPDF(String, String, String, String, int),
Constant Field Valuespublic static final int SIGNING_MODE_VERISIGN_SIGNED
PDFreactor.setSignPDF(String, String, String, String, int),
Constant Field Valuespublic static final int SIGNING_MODE_WINCER_SIGNED
PDFreactor.setSignPDF(String, String, String, String, int),
Constant Field Valuespublic static final int LOG_LEVEL_NONE
PDFreactor.setLogLevel(int),
Constant Field Valuespublic static final int LOG_LEVEL_FATAL
PDFreactor.setLogLevel(int),
Constant Field Valuespublic static final int LOG_LEVEL_WARN
PDFreactor.setLogLevel(int),
Constant Field Valuespublic static final int LOG_LEVEL_INFO
PDFreactor.setLogLevel(int),
Constant Field Valuespublic static final int LOG_LEVEL_DEBUG
PDFreactor.setLogLevel(int),
Constant Field Valuespublic static final int LOG_LEVEL_PERFORMANCE
PDFreactor.setLogLevel(int),
Constant Field Valuespublic static final String PAGE_ORDER_REVERSE
PDFreactor.setPageOrder(String),
Constant Field Valuespublic static final String PAGE_ORDER_ODD
PDFreactor.setPageOrder(String),
Constant Field Valuespublic static final String PAGE_ORDER_EVEN
PDFreactor.setPageOrder(String),
Constant Field Valuespublic static final String PAGE_ORDER_BOOKLET
PDFreactor.setPageOrder(String),
Constant Field Valuespublic static final String PAGE_ORDER_BOOKLET_RTL
PDFreactor.setPageOrder(String),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_LEFT_DOWN
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_RIGHT_UP
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_LEFT_UP
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_DOWN_LEFT
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_UP_RIGHT
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int PAGES_PER_SHEET_DIRECTION_UP_LEFT
PDFreactor.setPagesPerSheetProperties(int, int, String, String, String, int),
Constant Field Valuespublic static final int MERGE_MODE_APPEND
PDFreactor.setMergeMode(int),
Constant Field Valuespublic static final int MERGE_MODE_PREPEND
PDFreactor.setMergeMode(int),
Constant Field Valuespublic static final int MERGE_MODE_OVERLAY
PDFreactor.setMergeMode(int),
Constant Field Valuespublic static final int MERGE_MODE_OVERLAY_BELOW
PDFreactor.setMergeMode(int),
Constant Field Valuespublic static final int OVERLAY_REPEAT_NONE
PDFreactor.setOverlayRepeat(int),
Constant Field Valuespublic static final int OVERLAY_REPEAT_LAST_PAGE
PDFreactor.setOverlayRepeat(int),
Constant Field Valuespublic static final int OVERLAY_REPEAT_ALL_PAGES
PDFreactor.setOverlayRepeat(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_MODE_USE_NONE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_MODE_USE_OC
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PAGE_MODE_USE_ATTACHMENTS
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_HIDE_TOOLBAR
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_HIDE_MENUBAR
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_HIDE_WINDOW_UI
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_FIT_WINDOW
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_CENTER_WINDOW
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_DISPLAY_DOC_TITLE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN.
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_DIRECTION_L2R
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_DIRECTION_R2L
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PRINTSCALING_NONE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PRINTSCALING_APPDEFAULT
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_DUPLEX_SIMPLEX
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE
PDFreactor.setViewerPreferences(int),
Constant Field Valuespublic static final int PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES
PDFreactor.setProcessingPreferences(int),
Constant Field Valuespublic static final int COLOR_SPACE_RGB
PDFreactor.setDefaultColorSpace(int)public static final int COLOR_SPACE_CMYK
PDFreactor.setDefaultColorSpace(int)public static final int EXCEEDING_CONTENT_ANALYZE_NONE
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_ANALYZE_CONTENT
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_AGAINST_NONE
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_AGAINST_PAGE_BORDERS
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int EXCEEDING_CONTENT_AGAINST_PARENT
PDFreactor.setLogExceedingContent(int, int),
Constant Field Valuespublic static final int CONFORMANCE_PDF
PDFreactor.setConformance(int),
Constant Field Valuespublic static final int CONFORMANCE_PDFA
PDFreactor.setConformance(int),
Constant Field Values| Constructor Detail |
public PDFreactor()
PDFreactor.
| Method Detail |
public void setLicenseKey(String content)
String. If the license key is set
to null then PDFreactor looks for a 'licensekey.xml'
file in the same directory where the 'PDFreactor.jar' file is located.
If no license key could be found then PDFreactor runs in evaluation mode.
The default value is null.
content - The content of the license key as String.public void setDisableFontRegistration(boolean value)
Enables or disables the font registration. If font registration is enabled and a valid font cache exists then this font cache will be used. If font registration is disabled, any existing font cache will be ignored and the font directories will be scanned for font information.
The default value is false.
value - The new value of the font registration setting.PDFreactor.setCacheFonts(boolean),
PDFreactor.setFontCachePath(String),
PDFreactor.setFontDirectory(String)public void setCacheFonts(boolean value)
Enables or disables caching of font information.
During the PDF creation PDFreactor requires information about
fonts in the system. The process to get this information takes a
long time, thus PDFreactor offers an option to cache the collected
information about fonts.
A font cache can be reused by PDFreactor on every PDF creation
process but only if font registration is enabled. If font registration
is disabled then the font cache will be ignored. (see
PDFreactor.setDisableFontRegistration(boolean) for more information).
The default value is true.
value - The new value of the cache fonts setting.PDFreactor.setDisableFontRegistration(boolean),
PDFreactor.setFontCachePath(String),
PDFreactor.setFontDirectory(String)public void setFontCachePath(String location)
Sets the path of the font cache. This path will be used to read
and write the font cache. If the font cache path is set to
null then the "user.home" directory will be used.
The default value is null.
location - The path of the font cache.PDFreactor.setDisableFontRegistration(boolean),
PDFreactor.setCacheFonts(boolean),
PDFreactor.setFontDirectory(String)public void setFontDirectory(String location)
Sets the font directory from which fonts will be read. All files with the endings ".ttf", ".otf", ".afm" and ".ttc" will be read.
The default value of the font directory is "%system%".
location - The font directory.PDFreactor.setDisableFontRegistration(boolean),
PDFreactor.setCacheFonts(boolean),
PDFreactor.setFontCachePath(String)public void setLogLevel(int value)
Sets the log level.
Use one of the LOG_LEVEL_ constants to specify the log
level.
The default value is PDFreactor.LOG_LEVEL_NONE.
value - The new log level setting.PDFreactor.LOG_LEVEL_NONE,
PDFreactor.LOG_LEVEL_FATAL,
PDFreactor.LOG_LEVEL_WARN,
PDFreactor.LOG_LEVEL_INFO,
PDFreactor.LOG_LEVEL_DEBUG,
PDFreactor.LOG_LEVEL_PERFORMANCE,
PDFreactor.getLog()
public void setLogExceedingContent(int logExceedingContentAnalyze,
int logExceedingContentAgainst)
Whether to log content exceeding the page.
Use EXCEEDING_CONTENT_ANALYZE_ constants to specify
which kind of content should be observed for exceeding content logging.
The default value is PDFreactor.EXCEEDING_CONTENT_ANALYZE_NONE.
Use EXCEEDING_CONTENT_AGAINST_ constants to specify
that exceeding this content starts exceeding content logging.
The default value is PDFreactor.EXCEEDING_CONTENT_AGAINST_NONE.
logExceedingContentAnalyze - Enables logging of exceeding content
and optionally of boxes.logExceedingContentAgainst - Enables logging of exceeding content
either against the page edges, page
content areas or containers.PDFreactor.EXCEEDING_CONTENT_ANALYZE_NONE,
PDFreactor.EXCEEDING_CONTENT_ANALYZE_CONTENT,
PDFreactor.EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_BOXES,
PDFreactor.EXCEEDING_CONTENT_ANALYZE_CONTENT_AND_STATIC_BOXES,
PDFreactor.EXCEEDING_CONTENT_AGAINST_NONE,
PDFreactor.EXCEEDING_CONTENT_AGAINST_PARENT,
PDFreactor.EXCEEDING_CONTENT_AGAINST_PAGE_CONTENT,
PDFreactor.EXCEEDING_CONTENT_AGAINST_PAGE_BORDERSpublic void setThrowLicenseExceptions(boolean 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.
public void setBaseURL(String value)
Sets the base URL of the XML document.
To resolve relative URLs to absolute URLs a reference (base) URL is required. This reference URL is usually the system id of the document.
This method can be used to specify another reference URL. If this URL
is not null then it will be used instead of the system
id.
The default value is null.
value - The base URL for the document.public void setXSLTMode(boolean value)
Enables or disables XSLT transformations.
Set this value to true to enable XSLT transformations or
to false to disable XSLT transformations.
The default value is false.
value - The new XSLT mode.public void setEncoding(String value)
Sets the encoding of the document.
If this value is set to null or it is empty then the
encoding will be detected automatically.
The default value is null.
value - The encoding of the document or null for
autodetection.public void setCleanupTool(int value)
Sets the cleanup tool to use for documents with unparsable content.
The CLEANUP_ constants can be used as value. The
default value specified is PDFreactor.CLEANUP_CYBERNEKO.
value - The new cleanup tool.PDFreactor.CLEANUP_NONE,
PDFreactor.CLEANUP_JTIDY,
PDFreactor.CLEANUP_CYBERNEKO,
PDFreactor.CLEANUP_TAGSOUPpublic void setDocumentType(int value)
Sets the document type.
The DOCTYPE_ constants can be used to specify the
document type. The default value specified is
PDFreactor.DOCTYPE_AUTODETECT.
value - The new document type setting.PDFreactor.DOCTYPE_AUTODETECT,
PDFreactor.DOCTYPE_XML,
PDFreactor.DOCTYPE_XHTML
public void addUserStyleSheet(InputSource inputSource)
throws IOException
Adds a user style sheet to the document.
The specified input source will be loaded and then added.
inputSource - The InputSource of the style sheet.
IOException - If the style sheet could not be loaded.PDFreactor.addUserStyleSheet(String,String,String,String),
PDFreactor.removeAllUserStyleSheets()
public void addUserStyleSheet(String content,
String media,
String title,
String uri)
Adds a user style sheet to the document.
There are two ways to specify the style sheet:
content - The content of the style sheet.media - The media type of the style sheet.title - The title of the style sheet.uri - The URI of the style sheet.PDFreactor.addUserStyleSheet(InputSource),
PDFreactor.removeAllUserStyleSheets()public void removeAllUserStyleSheets()
Removes all user style sheets.
PDFreactor.addUserStyleSheet(InputSource),
PDFreactor.addUserStyleSheet(String,String,String,String)
public void addXSLTStyleSheet(String content,
String uri)
Adds an XSLT style sheet to the document.
There are two ways to specify the style sheet:
content - The content of the style sheet.uri - The URI of the style sheet.PDFreactor.removeAllXSLTStyleSheets()public void removeAllXSLTStyleSheets()
Removes all XSLT style sheets.
PDFreactor.addXSLTStyleSheet(String,String)public void setAuthor(String value)
Sets the value of the author field of the PDF document.
value - The author of the document.public void setCreator(String value)
Sets the value of creator field of the PDF document.
value - The creator of the document.public void setKeywords(String value)
Sets the value of the keywords field of the PDF document.
value - The keywords of the document.public void setTitle(String value)
Sets the value of the title field of the PDF document.
value - The title of the document.public void setSubject(String value)
Sets the value of the subject field of the PDF document.
value - The subject of the document.public void setDocumentDefaultLanguage(String 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.
languageCode - the default ISO 639 language code used for documents.public void setEncryption(int value)
Sets the encryption.
Use one of the ENCRYPTION_ constants to specify the
encryption. The default value is PDFreactor.ENCRYPTION_NONE.
value - The new encryption setting.PDFreactor.ENCRYPTION_NONE,
PDFreactor.ENCRYPTION_40,
PDFreactor.ENCRYPTION_128,
PDFreactor.setOwnerPassword(String),
PDFreactor.setUserPassword(String),
PDFreactor.setAllowAnnotations(boolean),
PDFreactor.setAllowAssembly(boolean),
PDFreactor.setAllowCopy(boolean),
PDFreactor.setAllowDegradedPrinting(boolean),
PDFreactor.setAllowFillIn(boolean),
PDFreactor.setAllowModifyContents(boolean),
PDFreactor.setAllowPrinting(boolean),
PDFreactor.setAllowScreenReaders(boolean)public void setFullCompression(boolean value)
Enables or disables full compression of the PDF document.
The default value is false.
value - Use true to enable full compression of the
document and false to disable full compression.public void setOwnerPassword(String value)
Sets the owner password of the PDF document.
The default value is null.
value - The new owner password.PDFreactor.setEncryption(int),
PDFreactor.setUserPassword(String)public void setUserPassword(String value)
Sets the user password of the PDF document.
The default value is null.
value - The new user password.PDFreactor.setEncryption(int),
PDFreactor.setOwnerPassword(String)public void setAddLinks(boolean value)
Enables or disables links in the PDF document.
The default value is false.
value - Use true to enable links in the document
and false to disable links.public void setAddBookmarks(boolean value)
Enables or disables bookmarks in the PDF document.
The default value isfalse.
value - Use true to enable bookmarks in the document
and false to disable bookmarks.public void setAddTags(boolean value)
Enables or disables tagging of the PDF document.
The default value is false.
value - Use true to enable tagging of the document
and false to disable tagging.public void setAddPreviewImages(boolean value)
Enables or disables embedding of image previews per page in the PDF document.
The default value is false.
value - Use true to enable embedding of image previews
per page in the document and false to disable embedding of
image previews per page.public void setPrintDialogPrompt(boolean value)
Enables or disables a print dialog to be shown upon opening the generated PDF document by a PDF viewer.
The default value is false.
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.public void setAppendLog(boolean value)
Specifies whether or not the log data should be added to the PDF document.
The default value is false.
value - Use true to add the log data to the document
and false if the log data should not be added.public void setAllowAnnotations(boolean value)
Enables or disables the 'annotations' restriction in the PDF document.
The default value is false.
value - Use true to enable 'annotations' in the document
and false to disable 'annotations'.PDFreactor.setEncryption(int)public void setAllowAssembly(boolean value)
Enables or disables the 'assembly' restriction in the PDF document.
The default value is false.
value - Use true to enable 'assembly' in the document
and false to disable 'assembly'.PDFreactor.setEncryption(int)public void setAllowCopy(boolean value)
Enables or disables the 'copy' restriction in the PDF document.
The default value is false.
value - Use true to enable 'copy' in the document
and false to disable 'copy'.PDFreactor.setEncryption(int)public void setAllowDegradedPrinting(boolean value)
Enables or disables the 'degraded printing' restriction in the PDF document.
The default value is false.
value - Use true to enable 'degraded printing' in
the document and false to disable 'degraded printing'.PDFreactor.setEncryption(int)public void setAllowFillIn(boolean value)
Enables or disables the 'fill in' restriction in the PDF document.
The default value is false.
value - Use true to enable 'fill in' in the document
and false to disable 'fill in'.PDFreactor.setEncryption(int)public void setAllowModifyContents(boolean value)
Enables or disables the 'modify contents' restriction in the PDF document.
The default value is false.
value - Use true to enable 'modify contents' in the
document and false to disable 'modify contents'.PDFreactor.setEncryption(int)public void setAllowPrinting(boolean value)
Enables or disables the 'printing' restriction in the PDF document.
The default value is false.
value - Use true to enable 'printing' in the document
and false to disable 'printing'.PDFreactor.setEncryption(int)public void setAllowScreenReaders(boolean value)
Enables or disables the 'screen readers' restriction in the PDF document.
The default value is false.
value - Use true to enable 'screen readers' in the
document and false to disable 'screen readers'.PDFreactor.setEncryption(int)public void setDisableFontEmbedding(boolean 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.
public void setFontFallback(String[] fontFallback)
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.
fontFallback - an array of font family namespublic void setPixelsPerInch(int 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.
public void setPixelsPerInchShrinkToFit(boolean pixelsPerInchShrinkToFit)
public void setMergeMode(int mode)
Sets the merge mode.
The following merge methods can be used:
PDFreactor.MERGE_MODE_APPEND)PDFreactor.MERGE_MODE_PREPEND)PDFreactor.MERGE_MODE_OVERLAY)PDFreactor.MERGE_MODE_OVERLAY_BELOW)The default value is PDFreactor.MERGE_MODE_APPEND.
mode - The merge mode.PDFreactor.MERGE_MODE_APPEND,
PDFreactor.MERGE_MODE_PREPEND,
PDFreactor.MERGE_MODE_OVERLAY,
PDFreactor.MERGE_MODE_OVERLAY_BELOWpublic void setMergeURL(String url)
This method sets a URL of an external PDF document which will be merged with the PDF document generated by the XML source.
PDFreactor.setMergeByteArray(byte[]),
PDFreactor.setMergeBeforePDF(boolean)public void setMergeURLs(String[] urls)
This method sets an array of URLs of external PDF documents which will be merged with the PDF document generated by the XML source.
public void setMergeByteArray(byte[] array)
This method sets a byte array containing an external PDF document which will be merged with the PDF document generated by the XML source.
PDFreactor.setMergeURL(String),
PDFreactor.setMergeURLs(String[]),
PDFreactor.setMergeByteArrays(byte[][]),
PDFreactor.setMergeMode(int)public void setMergeByteArrays(byte[][] arrays)
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.
.
PDFreactor.setMergeByteArray(byte[]),
PDFreactor.setMergeURL(String),
PDFreactor.setMergeURLs(String[]),
PDFreactor.setMergeMode(int)public void setMergeBeforePDF(boolean value)
PDFreactor.setMergeMode(int)
PDFreactor.setMergeMode(int)public void setOverlayRepeat(int 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 OBERLAY_REPEAT_ constants to specify the
overlay repeat. The default value is PDFreactor.OVERLAY_REPEAT_NONE.
PDFreactor.OVERLAY_REPEAT_NONE,
PDFreactor.OVERLAY_REPEAT_LAST_PAGE,
PDFreactor.OVERLAY_REPEAT_ALL_PAGESpublic void setPageOrder(String order)
Sets the page order of the direct result of the conversion.
order - A comma-separated list of page numbers and ranges is
intended as parameter. Alternatively, PAGE_ORDER_
constants can be used.PDFreactor.PAGE_ORDER_EVEN,
PDFreactor.PAGE_ORDER_ODD,
PDFreactor.PAGE_ORDER_BOOKLET,
PDFreactor.PAGE_ORDER_BOOKLET_RTL
public void setPagesPerSheetProperties(int cols,
int rows,
String sheetSize,
String sheetMargin,
String spacing,
int direction)
Sets the properties of a sheet on which multiple pages are being arranged.
If cols or rows is less than 1, no
pages-per-sheet processing is done. This is the case by default.
Use one of the PAGES_PER_SHEET_DIRECTION_ constants to
specify the the direction. The default value is PDFreactor.PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN.
cols - The number of columns per sheet.rows - The number of rows per sheet.sheetSize - The sheet size as CSS size, e.g. A4, letter landscape, 15in 20in,
20cm 30cm.sheetMargin - The sheet margin as CSS margin, e.g. 1in, 1cm 1.5cm, 10mm 20mm 10mm 30mm. null is
interpreted as 0mm.spacing - The horizontal and vertical space between pages on a sheet as CSS value, e.g. 0.1in, 5mm 2mm. null is
interpreted as 0mm.direction - The direction in which the pages are ordered on a sheet.PDFreactor.PAGES_PER_SHEET_DIRECTION_DOWN_LEFT,
PDFreactor.PAGES_PER_SHEET_DIRECTION_DOWN_RIGHT,
PDFreactor.PAGES_PER_SHEET_DIRECTION_LEFT_DOWN,
PDFreactor.PAGES_PER_SHEET_DIRECTION_LEFT_UP,
PDFreactor.PAGES_PER_SHEET_DIRECTION_RIGHT_DOWN,
PDFreactor.PAGES_PER_SHEET_DIRECTION_RIGHT_UP,
PDFreactor.PAGES_PER_SHEET_DIRECTION_UP_LEFT,
PDFreactor.PAGES_PER_SHEET_DIRECTION_UP_RIGHT
public void setBookletMode(String sheetSize,
String sheetMargin,
boolean rtl)
Convenience method to set pages-per-sheet properties and page order in one step to create a booklet.
sheetSize - The size of the sheet as CSS value, e.g. A3,
letter landscape, 15in 20in,
20cm 30cm.sheetMargin - The sheet margin as CSS margin value, e.g.
1in, 1cm 1.5cm, 10mm
20mm 10mm 30mm.
null is interpreted as 0mm.rtl - Whether or not the reading order of the booklet should be
right-to-left .public void setViewerPreferences(int 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.
viewerPreferences - A value of ORed VIEWER_PREFERENCES_ constants.PDFreactor.VIEWER_PREFERENCES_CENTER_WINDOW,
PDFreactor.VIEWER_PREFERENCES_DIRECTION_L2R,
PDFreactor.VIEWER_PREFERENCES_DIRECTION_R2L,
PDFreactor.VIEWER_PREFERENCES_DISPLAY_DOC_TITLE,
PDFreactor.VIEWER_PREFERENCES_DUPLEX_FLIP_LONG_EDGE,
PDFreactor.VIEWER_PREFERENCES_DUPLEX_FLIP_SHORT_EDGE,
PDFreactor.VIEWER_PREFERENCES_DUPLEX_SIMPLEX,
PDFreactor.VIEWER_PREFERENCES_FIT_WINDOW,
PDFreactor.VIEWER_PREFERENCES_HIDE_MENUBAR,
PDFreactor.VIEWER_PREFERENCES_HIDE_TOOLBAR,
PDFreactor.VIEWER_PREFERENCES_HIDE_WINDOW_UI,
PDFreactor.VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_NONE,
PDFreactor.VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OC,
PDFreactor.VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_OUTLINES,
PDFreactor.VIEWER_PREFERENCES_NON_FULLSCREEN_PAGE_MODE_USE_THUMBS,
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_ONE_COLUMN,
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_SINGLE_PAGE,
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_LEFT,
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_COLUMN_RIGHT,
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_LEFT,
PDFreactor.VIEWER_PREFERENCES_PAGE_LAYOUT_TWO_PAGE_RIGHT,
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_FULLSCREEN,
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_USE_NONE,
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_USE_OC,
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_USE_OUTLINES,
PDFreactor.VIEWER_PREFERENCES_PAGE_MODE_USE_THUMBS,
PDFreactor.VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_FALSE,
PDFreactor.VIEWER_PREFERENCES_PICKTRAYBYPDFSIZE_TRUE,
PDFreactor.VIEWER_PREFERENCES_PRINTSCALING_APPDEFAULT,
PDFreactor.VIEWER_PREFERENCES_PRINTSCALING_NONEpublic void setConformance(int conformance)
Sets the conformance of the PDF.
The CONFORMANCE_ constants can be used as value. The default
value specified is PDFreactor.CONFORMANCE_PDF.
conformance - Any of the conformance constants.PDFreactor.CONFORMANCE_PDF,
PDFreactor.CONFORMANCE_PDFApublic void setDefaultColorSpace(int defaultColorSpace)
Sets whether to convert color key words to CMYK instead of RGB.
The COLOR_SPACE_ constants can be used as value.
The default value specified is PDFreactor.COLOR_SPACE_RGB.
defaultColorSpace - the default color space of the PDFPDFreactor.COLOR_SPACE_CMYK,
PDFreactor.COLOR_SPACE_RGB
public void setOutputIntentFromURL(String identifier,
String profileUrl)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
identifier - the OutputConditionIdentifierprofileUrl - the DestOutputProfile
public void setOutputIntentFromByteArray(String identifier,
byte[] profileData)
Sets the output intent including the identifier and the ICC profile to be embedded into the PDF.
identifier - the OutputConditionIdentifierprofileData - the DestOutputProfilepublic void setProcessingPreferences(int 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.
processingPreferences - A value of ORed processing preferences flags.PDFreactor.PROCESSING_PREFERENCES_SAVE_MEMORY_IMAGES
public void setAuthenticationCredentials(String username,
String password)
Enables access to resources that are secured via Basic or Digest authentication.
username - The user name for the secured realm.password - The password for the secured realm.
public void setRequestHeader(String key,
String value)
Adds a request header to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
key - The key of the header.value - The value of the header.
public void setCookie(String key,
String value)
Adds a cookie to all outgoing HTTP connections. If the key already exists, the pair is overwritten.
key - The key of the cookie.value - The value of the cookie.
public void setSignPDF(String keystoreURL,
String keyAlias,
String keystorePassword,
String keystoreType,
int 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.
keystoreURL - The URL to the keystore file.keyAlias - The alias of the certificate included in the keystore to be used to sign the PDF.keystorePassword - The password of the keystore.keystoreType - The format of the keystore, i.e. pkcs12 or jks.
Use one of the KEYSTORE_TYPE_ constants as value.signingMode - The mode that is used to sign the PDF, i.e. self-signed,
Windows certificate or VeriSign.
Use one of the SIGNING_MODE_ constants as value.PDFreactor.KEYSTORE_TYPE_JKS,
PDFreactor.KEYSTORE_TYPE_PKCS12,
PDFreactor.SIGNING_MODE_SELF_SIGNED,
PDFreactor.SIGNING_MODE_VERISIGN_SIGNED,
PDFreactor.SIGNING_MODE_WINCER_SIGNED
public void renderDocument(InputSource inputSource,
OutputStream outputStream)
throws SAXException,
IOException,
TransformerException
Generates a PDF document from an InputSource.
The resulting PDF document will be written into an OutputStream.
inputSource - The InputSource of the XML document.outputStream - The OutputStream where the PDF RAW data will be
written into.
TransformerException
com.realobjects.lowagie.text.DocumentException
IOException
SAXExceptionPDFreactor.renderDocumentFromURL(String),
PDFreactor.renderDocumentFromByteArray(byte[]),
PDFreactor.renderDocumentFromContent(String)
public byte[] renderDocumentFromURL(String url)
throws SAXException,
IOException,
TransformerException
Generates a PDF document from an XML document at a URL.
url - A URL pointing to the XML document.
TransformerException
com.realobjects.lowagie.text.DocumentException
IOException
SAXExceptionPDFreactor.renderDocumentFromByteArray(byte[]),
PDFreactor.renderDocumentFromContent(String)
public byte[] renderDocumentFromByteArray(byte[] array)
throws SAXException,
IOException,
TransformerException
Generates a PDF document from an XML document inside a byte array.
array - An array containing the content of the XML document.
TransformerException
com.realobjects.lowagie.text.DocumentException
IOException
SAXExceptionPDFreactor.renderDocumentFromURL(String),
PDFreactor.renderDocumentFromContent(String)
public byte[] renderDocumentFromContent(String content)
throws SAXException,
IOException,
TransformerException
Generates a PDF document from an XML document inside a String.
content - A String containing the content of the XML document.
TransformerException
com.realobjects.lowagie.text.DocumentException
IOException
SAXExceptionPDFreactor.renderDocumentFromURL(String),
PDFreactor.renderDocumentFromByteArray(byte[])public void addProgressEventListener(ProgressEventListener listener)
Adds a ProgressEventListener.
listener - The ProgressEventListener to add.public void removeProgressEventListener(ProgressEventListener listener)
Removes a ProgressEventListener.
listener - The ProgressEventListener to remove.public void setLogger(Logger object)
Sets a Logger to receive log messages.
The default value is null.
object - The Logger to use.PDFreactor.getLogger()public Logger getLogger()
Returns the Logger used by this PDFreactor.
Logger.PDFreactor.setLogger(Logger)public String getError()
Returns the error messages generated during rendering.
String.public String getLog()
Returns the log messages generated during rendering based on the log level.
String.PDFreactor.setLogLevel(int)public ExceedingContent[] getExceedingContents()
Provides information about content exceeding its page or parent. Depends on the mode set via PDFreactor.setLogExceedingContent(int, int).
ExceedingContent objects
or null if the logging of exceeding content was not enabled
or no conversion was run, yet.public int getNumberOfPages(boolean 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:
PDFreactor.renderDocument(InputSource, OutputStream)PDFreactor.renderDocumentFromByteArray(byte[])PDFreactor.renderDocumentFromContent(String)PDFreactor.renderDocumentFromURL(String)
pdf - If true, returns the number of pages of the
resulting PDF (including, e.g., merge operations), otherwise
it will return the number pages of the converted input
document.
|
PDFreactor API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||