#1315·pdf-lib

Differentiate between document open password and permission password

Author: TobiKo22Created Sep 20, 2022Updated Mar 18, 2026
Labelsproposalneeds-triage

Describe your idea

Hello,

I would like to make a request in the case of reading encrypted PDF-Documents. The method "isEncrypted" does not differentiate between a document open password and permission password, as its described here: https://helpx.adobe.com/acrobat/using/securing-pdfs-passwords.html

The reason why I want to differentiate between those password protection "types", I want to display the documents in a viewer protected by permission password as recipients don’t need a password to open the document and displaying should be possible.

At the moment I can only check if any password is set, so I cannot display documents, which "only" requires a permission password e.g for editing, printing.....

How could this be implemented?

We need an additional method which only check if a document has a permission password. Differentiate the "isEncrypted" method in:

  1. isOpenEncrypted (for document open password)
  2. isPermissionEncrypted (for permission password like editing, copying, printing)

What problem are you trying to solve?

I want to differentiate between those password protection "types", I want to display the documents in a viewer protected by permission password as recipients don’t need a password to open the document and displaying should be possible.

At the moment I can only check if any password is set, so I cannot display those documents.

Why does this matter to you?

I implemented your libraray to split pdf-documents and to get the metadata of the pdf document structure. In this case, I check if a document is password protected, to differentiate if the document should be displayed in the viewer.

Would others find this helpful?

Yes, there is another feature request: https://github.com/Hopding/pdf-lib/issues/291

Are you interested in implementing your proposal?

Yes

Why are you submitting a proposal?

Yes i want to know if it's feasible and then implement the feature.

Additional Notes

No response