2019.1

Table Of Contents
Field Type Description
height float The height of the current page (in points).
page Number Current page number (counting from 1) within the resource.
pages Number The total number of pages in the resource.
permissions
Permissions
PDF only. Allows to verify if a PDF is password-protected
or has restrictions for printing.
width float The width of the current page (in points)
Examples
This script retrieves the second page of a PDF that is present in the template's resources.
var pdf = resource("images/stamp.pdf", 2);
var height = pdf.height;
var width = pdf.width;
var numberOfPages = pdf.pages;
In the following script, the function is used to check if a file exists.
if(resource("C:/paw.pdf")){
//exists
} else {
//oops
}
section
The section object can be used to query and modify how the section (and the related context)
will be outputted. It is one of the most important objects in Control Scripts (see "Control Scripts"
on page390 and "Control Script API" on page811).
Retrieving a section
A section can be retrieved using merge.template.contexts.ContextType.sections["section
name"], for example: merge.template.contexts.PRINT.sections["Section EN"].
Page 817