From 456def6a113f7a16467b0bf4baa22324050fef50 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Sun, 15 Dec 2024 21:59:49 +0100 Subject: [PATCH] metadata: correct the problem of reading PDF encrypted --- public/js/metadata.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/js/metadata.js b/public/js/metadata.js index d6bf4a3..39f8f26 100644 --- a/public/js/metadata.js +++ b/public/js/metadata.js @@ -163,8 +163,7 @@ async function save() { const PDFHexString = window['PDFLib'].PDFHexString const PDFName = window['PDFLib'].PDFName - const arrayBuffer = await pdffile.arrayBuffer(); - const pdf = await PDFDocument.load(arrayBuffer); + const pdf = await PDFDocument.load(await pdffile.arrayBuffer(), { ignoreEncryption: true, password: "" }); deletedMetadata.forEach(function (el) { pdf.getInfoDict().delete(PDFName.of(el))