Skip to content

Commit

Permalink
metadata: correct the problem of reading PDF encrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
wincelau committed Dec 15, 2024
1 parent 6615556 commit 456def6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions public/js/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 456def6

Please sign in to comment.