PDF object
The PDF object defines methods to open, close and save files, as well as to access meta information such as the XMP attachment. It contains a Pages collection object to access the list of pages in the PDF.
To instantiate the PDF object, call the Watch.GetPDFEditObject method in Workflow's scripting environment.
Javascript implementation: var myPDF = Watch.GetPDFEditObject();
VBScript implementation: set myPDF = Watch.GetPDFEditObject
PDF methods
Name |
Return type |
Description |
---|---|---|
|
Closes the PDF file. If changes were made but not saved, they are silently lost. All IPage objects must be released before closing a PDF. |
|
|
Creates a new empty PDF file. |
|
ExtractPDFVTMetadataAsJsonStr() | String | Extracts PDF/VT metadata and returns it as JSON string. |
Retrieves the contents of the Document Information Dictionary from the PDF. |
||
String |
Retrieves the XMP attachment embedded in the PDF. |
|
String |
Retrieves the entire extractable text from the PDF in XYML format. |
|
Boolean |
Returns True if the PDF file is password-protected. When a file is password-protected, the OpenEx() method must be used instead of the Open() method. |
|
|
Merges the pages of pdfFilename (the source) with the pages of the current PDF (the destination). |
|
MergeWith2(pdfFilename, xnum, ynum, xoffset, yoffset, scaleFactor) |
|
Overlays each page of pdfFilename (the source) onto pages of the current PDF (the destination) in a grid whose size is specified by xnum and ynum. The pages are laid from left to right and then from top to bottom. |
|
Opens an existing PDF, optionally repairing it. |
|
|
Opens an existing, password-protected PDF, optionally repairing it. |
|
Pages (see Pages collection object) |
Provides access to the Pages collection of the PDF. |
|
|
Prints a range of PDF pages to the specified Windows printer with default options. |
|
|
Prints a range of PDF pages to the specified Windows printer with specific printer options stored in an PdfPrintParams structure. |
|
|
Saves changes to the PDF file. The version of the PDF file format is the highest possible for a newly created file and is unchanged when saving an existing file, unless the SetVersion method was called in which case the file format used will be the one set by SetVersion. |
|
|
Sets the contents for the PDF's Document Information Dictionary. |
|
|
Sets the version of the underlying PDF file format. This is applied when the file is saved. |
|
|
Sets the XMP attachment by replacing the existing one with xmpPacket. |