Some test text!



PDF Security Permissions
Custom security
Get started
Tools & Utilities

Security on a PDF document protects the content from unauthorized access like copying or printing. PDF documents can be secured and encrypted using various encryption schemes. Control over document security in PDFTron SDK is performed through security handlers. Security handlers perform user authorization and sets various permissions over PDF documents. Although PDFTron SDK offers an extension mechanism through which users can register custom security handlers, it also provides a standard security handler.

This built-in security handler is the Standard Security Handler (StdSecurityHandler). The Standard Security Handler supports two passwords:

  • A user password that permits a user to open and read a protected document only with whatever permissions the owner chose.
  • An owner password can grant a document owner free reign over what permissions are granted to users.

An application can also create its own implementation of SecurityHandler. For example, a custom SecurityHandler could perform user authorization requiring the presence of a hardware dongle or even feedback from a biometric system.

A Security Handler is used when:

  • A document is opened. The security handler must determine whether a user is authorized to open the file. It must also set up the RC4 decryption key used to decrypt the file.
  • A document is saved. The security handler must set up the RC4 encryption key and write security information into the PDF file's encryption dictionary.
  • A user tries to change a document's security settings. Note that the Standard Security Handler in PDFTron SDK does not enforce a document's permissions. For example, it is possible to edit a document although document modification permission is not granted. Therefore, it is up to the application to respect PDF permissions.

The number of security handlers associated with a document change over time. When the document is first opened it isn't associated with any security handlers. When InitSecurityHandler (or InitStdSecurityHandler) is called on the document, that security handler is associated with the document. And when SetSecurityHandler is called on a document, that security handler is also associated with the document—albeit in a pending state until the document is saved. Until the document is saved with the new security handler, the old security handler rules the document's security.

A document may have both a current and a new security handler associated with it. A PDF document is not fully loaded in memory and decrypted when it is loaded. To fully decrypt the document, even after applying a new security handler, the original security handler is still required.

PDFTron SDK benefits include:

  • Support for Standard PDF security handler (40 and 128 bit RC4 encryption)
  • Support for 128 bit AES (Advanced Encryption Standard) encryption
  • Support for custom security handlers
  • Support for Crypt encryption filters
  • Set or modify security permissions associated with a document
  • Remove encryption from existing PDF documents
  • Powerful extension mechanism allowing for seamless integration with client applications

linkPDF Security Permissions

The security mechanism for the high-level document works in the same way as with an SDF document. To secure a document, use the PDFDoc.SetSecurityHandler() method. To open a secured document, call PDFDoc.InitSecurityHandler(). To open a document with a password, call PDFDoc.InitStdSecurityHandler().

The following table lists security permissions available through the standard security handler:

e_ownerAll permissions are granted.
e_doc_openA permission to open a document.
e_doc_modifyModify the contents of the document.
e_printPrint the document.
e_print_highPrint the document to a representation from which a faithful digital copy of the PDF content could be generated. When this permission is not set, printing is limited to a low level representation of the appearance, possibly of degraded quality.
e_extract_contentCopy or otherwise extract text and graphics from the document.
e_mod_annotAdd or modify text annotations, fill in interactive form fields.
e_fill_formsFill in existing interactive form fields (including signature fields).
e_access_supportExtract text and graphics (in support of accessibility to disabled users or for other purposes).
e_assemble_docAssemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if e_doc_modify is not set.

linkCustom security

Besides providing full support for standard PDF security, PDFTron SDK allows users to work with custom security handlers and proprietary encryption algorithms. To define a custom security handler, derive a class from SecurityHandler and implement SecurityHandler's interface.

Please see the PDFTron SDK Net Knowledge Base or contact for more details.

linkGet started

Securing a document with encryption
To secure a document with password protection and adjusting permissions on the document.

Reading a document with encryption
To read a document with password protection without user feedback.

Samples related to security.

APIs related to security.

linkTools & Utilities

A command-line tool that can be used for adding, removing, or changing security settings on existing PDF documents or whole directories of documents.

Get the answers you need: Support


PDF Security Permissions
Custom security
Get started
Tools & Utilities