Dectect document with password protection

Which product are you using?

PDF.js Express Plus
PDF.js Express Version

Detailed description of issue
People are uploading password protected documents to our portal, we need to detect the document with password protection and inform user to remove password.

Expected behaviour
Identify documents who have password protection

Does your issue happen with every document, or just one?
Issue with password protected documents

Link to document
NA

Code snippet
NA

Hi there,

We do not have an API to detect if a document is password protected. You could programatically add the password into the loadDocument API to open a password protected document.

You can also use the loaderror event to handle if the document fails to load:

And then use a custom modal to display your message:
https://pdfjs.express/api/UI.html#.addCustomModal__anchor

Best regards,
Kevin Kim