mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-11 01:14:35 +01:00
feat: enable loading of encrypted PDFs by adding ignoreEncryption option
This commit is contained in:
1 parent
816dc311ae
commit
9d362b1cf8
24 files changed
+56
-17
No files matched your search
@@ -98,7 +98,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
result.pdf.destroy();
|
||||
state.files[0] = result.file;
|
||||
state.pdfDoc = await PDFLibDocument.load(result.bytes);
|
||||
state.pdfDoc = await PDFLibDocument.load(result.bytes, {
|
||||
ignoreEncryption: true,
|
||||
});
|
||||
}
|
||||
// Update page count
|
||||
metaSpan.textContent = `${formatBytes(file.size)} • ${state.pdfDoc.getPageCount()} pages`;
|
||||
@@ -146,7 +148,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
result.pdf.destroy();
|
||||
state.files[0] = result.file;
|
||||
state.pdfDoc = await PDFLibDocument.load(result.bytes);
|
||||
state.pdfDoc = await PDFLibDocument.load(result.bytes, {
|
||||
ignoreEncryption: true,
|
||||
});
|
||||
showLoader('Rendering page previews...');
|
||||
} else {
|
||||
throw new Error('No PDF document loaded');
|
||||
|
||||
Reference in new issue
Block a user