Skip to main content
Version: Next

Encrypted and Permission-Restricted PDFs

PDF documents can be encrypted with a password. A PDF can have up to two passwords:

  • User password (also called open password): needed to open the document at all.
  • Owner password (also called permissions password): restricts certain operations, e.g. "printing not allowed" or "changing the document not allowed". A PDF with only an owner password can be opened by anyone, but the restrictions (permissions) still apply.

This page describes how jadice flow and jadice server behave by default when such documents are converted to PDF / PDF/A (reshape).

Scope​

ProductComponentStatus
jadice flowto-pdf worker (worker definitions such as item-to-pdf, part-to-pdf), with and without PDF/A conformanceverified with test documents
jadice serverReshapeNode with target application/pdf (optionally followed by PdfaNode)same mechanism: the jadice flow to-pdf worker uses these jadice server nodes internally

Note: Other PDF operations of jadice server (e.g. merge, split) use their own permission checks and are not covered by this page.

Behavior per restricted permission​

The following table applies to PDFs that are protected by an owner password only (no user password):

Permission restricted in the PDFBehavior during reshape
Printing (incl. high-resolution printing)Processing is aborted
High-resolution printing only (low-resolution printing allowed)Processing is aborted
Changing the documentProcessing is aborted
Adding annotations / commentsProcessing is aborted
Filling in form fieldsProcessing is aborted
Document assembly (insert, delete, rotate pages)Processing is aborted
Copying text / graphicsNo effect, processing succeeds
Content extraction for accessibilityNo effect, processing succeeds

If several permissions are restricted, processing is aborted as soon as at least one of the "aborting" permissions above is restricted.

The behavior is independent of the encryption algorithm. It has been verified for RC4 40 bit, RC4 128 bit, AES 128 bit and AES 256 bit (revision 5 and 6).

PDFs with a user password​

PDFs that require a user password to be opened cannot be processed. Processing is aborted regardless of the permissions set in the document. There is no option to pass a user password to the reshape step.

Such documents have to be decrypted before they are passed to jadice flow. They can also be decrypted in jadice flow with the pdf-permissions worker if the owner password is known (see Options).

To detect such documents upfront, use the analyzer worker. For PDFs it sets the part properties is-encrypted, is-owner-permission and requires-user-password. You can use these properties in your job flow, for example to route such documents to a separate step.

What happens when processing is aborted​

  • The job ends with status FAILED (exit status FAILED). No result part is created.
  • The step (e.g. item-to-pdf) ends with exit status FAILED. The item and part are marked with state ERROR, and the cause is attached as a message ID and message.
  • You can see the message in the flow controller UI in the job and item details. Via the REST API, request GET /job/execution/{id}?addAuditInfo=true.
CauseMessage IDMessage
Restricted permission, target PDF without PDF/AJS.DOCP-EXPORT_PROHIBITEDCould not convert the document. Export is prohibited by permissions.
Restricted permission, target PDF/AJS.SERVER-WORKER_FAILEDWorker for node PdfaNode failed due to JS.DOCP-EXPORT_PROHIBITED: Could not convert the document. Export is prohibited by permissions.
User password setDOCP.DOC-FORMAT_READ_FAILED (wrapped in JS.SERVER-WORKER_FAILED for PDF/A)Reading a stream failed with an unexpected exception

Note: The message for documents with a user password is the same as for other read errors (e.g. structurally damaged PDFs). Use the analyzer properties described above if you need to tell these cases apart.

Options​

The default behavior described above cannot be changed in the to-pdf worker. The PDF Permissions technology package (pdf-permissions worker) can be placed in front of the conversion step:

  • Remove restrictions with known owner passwords: The pdf-permissions worker with the parameter passwordList removes the encryption from PDFs whose owner password is in the list. If none of the passwords matches, the job fails.
  • Grant all permissions on owner-password-protected PDFs: With jadice.pdfpermissions.grantAllPermissionsOnOwnerPasswordProtectedDocuments: true (or the worker definition pdf-permissions-static), the worker rewrites PDFs that are protected by an owner password only, and grants all permissions. No owner password is needed. Documents with a user password still fail with "Document has non-empty user password."

Note: Both options remove restrictions that were set by the author of the document. Before you use them, consult your legal department to determine whether and in which cases this is allowed for your processes and types of documents. Configure passwords as secrets (or Base64-encoded) and do not log them.