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

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 printingAllowed will be unknown.

Field Type Description
hasPassword Boolean

Will be true if the resource is a password protected PDF.

Note, there are two types of passwords in protected PDFs:

  1. Password required for opening the PDF.

  2. Password required for changing permissions.

OL Connect only cares about the first type of password and ignores the second.

printingAllowed String Will be either "highres" (full permissions), "lowres", "none", or "unknown".

Example

The following script logs the permissions for a PDF.

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