2022.2

Table Of Contents
VOID Close ()
Note: Before using Close() in Javascript, you should call the CollectGarbage() global method to ensure
all references to pages are properly discarded. This additional statement is not required with other lan-
guages. For instance:
var objPDF = Watch.GetPDFEditObject();
objPDF.Open(Watch.GetJobFileName(), false);
var objPages = objPDF.Pages();
var objPage = null;
for(var i=0; i<objPages.Count(); i++) {
objPage = objPages.Item(i);
}
objPage=null;
objPages=null;
CollectGarbage();
objPDF.Close();
If you run the above code without calling the CollectGarbage() method, the Close() method will error
out.
Create(filename)
Creates a new empty PDF file. See also: "Save()" on page201.
Syntax
VOID Create (STRING filename)
filename
Name of the file to create. The file is not physically written to disk until IPDF.Save() is called.
ConvertToVDX(pdfFilename, ppmlFilename)
Converts a PDF file to a VDX file by adding the necessary entries in the catalog and root dictionaries as
well as embedding a PPML file as a stream object in the PDF. The validity of the PPML is left to the
caller.
This method opens, modifies, saves and closes the specified PDF file. This means that, contrary to the
other methods of the IPDF interface, this method works on - and only on - the PDF file specified by the
first argument; IPDF.Open() or .Create() do not need to be called beforehand. If they were called, the
file opened or created by these methods is untouched (unless of course pdfFilename specifies the
same filename as Open()).
Syntax
VOID ConvertToVDX (STRING pdfFilename, STRING ppmlFilename)
Page 196