2020.1

Table Of Contents
Field Type Description
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
}
Permissions
Allows to verify if a PDF is password-protected or has restrictions for printing.
This is part of the information about an image that is returned by the resource() function; see
"resource()" on the previous page).
Note
If a PDF that does not allow content copying, Connect cannot handle the PDF at all and we cannot
determine the permissions. In that case hasPassword will be true (even if the password is not
set) and printingAllowedwill be unknown.
Field Type Description
hasPassword Boolean Will be true if the resource is a password protected PDF.
printingAllowed String Will be either "highres" (full permissions), "lowres", "none",
or "unknown".
Page 1366