You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to render encrypted document using pdf-js library on UI. However, it is throwing the following error:
pdf-lib.js:6475 Uncaught (in promise) Error: Input document to PDFDocument.load is encrypted. You can use PDFDocument.load(..., { ignoreEncryption: true }) if you wish to load the document anyways.
How did you attempt to do it?
I tried adding { ignoreEncryption: true } property to handle this scenario.
What actually happened?
This is just preventing the exception thrown by the library, but is not rendering the document. Is there any way we can render the encrypted document using pdf-lib js library?
What did you expect to happen?
I am expecting the encrypted pdf to be rendered using pdf-lib js library.
Note: The PDF is rendered perfectly using Postman, I am facing this issue only when rendering the pdf using pdf-lib js library.
How can we reproduce the issue?
We can try to render encrypted pdf using pdf-lib library.
Attached is the PDF file which we are trying to render. ICF TEMP.pdf
perhaps you can try to build from this fork and load your PDF. It looks like if the document is encrypted, it will attempt to decrypt it. (looking at the written tests)
What were you trying to do?
Hi,
I am trying to render encrypted document using pdf-js library on UI. However, it is throwing the following error:
pdf-lib.js:6475 Uncaught (in promise) Error: Input document to
PDFDocument.load
is encrypted. You can usePDFDocument.load(..., { ignoreEncryption: true })
if you wish to load the document anyways.How did you attempt to do it?
I tried adding { ignoreEncryption: true } property to handle this scenario.
What actually happened?
This is just preventing the exception thrown by the library, but is not rendering the document. Is there any way we can render the encrypted document using pdf-lib js library?
What did you expect to happen?
I am expecting the encrypted pdf to be rendered using pdf-lib js library.
Note: The PDF is rendered perfectly using Postman, I am facing this issue only when rendering the pdf using pdf-lib js library.
How can we reproduce the issue?
We can try to render encrypted pdf using pdf-lib library.
Attached is the PDF file which we are trying to render.
ICF TEMP.pdf
Code:
Javascript:
const pdfDoc: any = await PDFDocument.load(existingPdfBytes, { ignoreEncryption: true });
const pdfDataUri: any = await pdfDoc.saveAsBase64({ dataUri: true });
pdfBase64.value = pdfDataUri;
document.getElementById('view-pdf').src = pdfDataUri + '#toolbar=0&navpanes=0';
HTML
<iframe id="view-pdf" style="width: 100%; height: 95%;"></iframe>Version
1.17.1
What environment are you running pdf-lib in?
Browser
Checklist
Additional Notes
No response
The text was updated successfully, but these errors were encountered: