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()).

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);