What this demonstrates
Separate opening security from access permissions
The user password controls who can open the PDF. The master password protects the permission policy that governs printing, copying, form completion, and document modification.
PDF permissions are advisory controls enforced by compatible readers. TX Text Control combines the selected flags and applies them while creating the encrypted file.
API used
SaveSettings.DocumentAccessPermissions
How it works
The controller builds a bitwise DocumentAccessPermissions value, assigns both passwords to SaveSettings, and creates an encrypted download. A separate unencrypted copy is returned only for immediate preview in the demo.
Source files
See the implementation
The complete demo is encapsulated in Demos/Pdf/Security/Encryption.