-1

I'm using react-pdf package to handle PDF files on my website. The issue lies in the fact that every time we upload a password protected file, it asks for password using a browser prompt. I want to change this behavior. Instead of a password prompt to block the user experience I want to disable it; only when the user try to download and view the PDF file, he may be asked for a password.

enter image description here This dialog opens as again as soon as I click on cancel.

I scorched through the docs on npmjs.com and they've suggested to using onPassword prop inside the Document element but it seems to be unavailable

enter image description here

I'm using version 5 of react-pdf. Any guidance on this issue would be much appreciated

  • I don't want to open it. Once it is uploaded, it shouldn't throw the password dialog. Unless someone click on it or downloads it. – Rudra Gaur Aug 30 '23 at 03:55

0 Answers0