Security

JavaScript in PDF documents operates under a security model that protects users from potentially harmful operations. Certain functions are marked as "secure" and can only be executed in trusted contexts.

Secure vs. non-secure functions

Non-secure functions can be called from any context:

  • Reading form field values

  • Basic calculations

  • Displaying alerts

  • Navigating pages

  • Form manipulations

Secure functions require elevated privileges:

Quick reference

Establishing trust:

Common secure operations:

  • File I/O

  • System paths

  • URL launching

  • Data import/export

Moving forward

Understanding trusted functions and the security model enables powerful automation while maintaining safety. Folder-level scripts are the key to bridging the gap between untrusted PDF contexts and secure system operations. Next up we will look at a few more PDF-specific concepts you will need.

Resources

Revu 21

Revu JavaScript

JavaScript

Learh how JavaScript in PDF documents operates under a security model that protects users from potentially harmful operations.