2022.1

Table Of Contents
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".
Example
The following script logs the permissions for a PDF.
var pdf = resource("images/myPDF.pdf");
var willPrint = pdf.permissions.printingAllowed;
var hasPW = pdf.permissions.hasPassword;
logger.info('Printing restrictions: ' + willPrint);
logger.info('Password-protected: ' + hasPW);
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 page954 and "Control Script API" on page1466).
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"].
A section can also be retrieved via merge.context.sections['section name']. Remember,
however, that when several contexts need to be merged (for example, when the Print context is
attached to an email), the script needs to check if the current context is of the type that contains
the desired section (for example: if (merge.context.type == ContextType.PRINT) {}). When
Page 1478