Skip to content

Commit

Permalink
organization: update of the pdf-lib.js lib with the fork https://gith…
Browse files Browse the repository at this point in the history
…ub.com/cantoo-scribe/pdf-lib which is more maintained than the original repository, which allows to correct the problem of reading PDF encrypter
  • Loading branch information
wincelau committed Dec 15, 2024
1 parent 395c0d3 commit 6615556
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ DEBUG=1 make test
- **OpenType.js** Tools for converting text and its font into paths: https://github.com/opentypejs/opentype.js (MIT)
- **ImageMagick** Image manipulation toolset: https://imagemagick.org/ (Apache-2.0)
- **Caveat** Handwriting-style font: https://github.com/googlefonts/caveat (OFL-1.1)
- **PDF-LIB** JavaScript library for PDF manipulation used for writing metadata: https://pdf-lib.js.org/ (MIT)
- **PDF-LIB** JavaScript library for PDF manipulation used for writing metadata: https://pdf-lib.js.org/ (MIT), we use the fork https://github.com/cantoo-scribe/pdf-lib maintained
- **Ghostscript** GPL Ghostscript is a software suite for processing PostScript and PDF file formats (GPLv3)
- **GPG** GnuPG allows you to encrypt and sign your data and communications (GPLv3)

Expand Down
2 changes: 1 addition & 1 deletion public/js/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ async function save(order) {
filename += '_';
}
filename += document.querySelector('#input_pdf').files.item(i).name.replace(/\.pdf$/, '');
pdfFile = await PDFDocument.load(await document.querySelector('#input_pdf').files.item(i).arrayBuffer());
pdfFile = await PDFDocument.load(await document.querySelector('#input_pdf').files.item(i).arrayBuffer(), { ignoreEncryption: true, password: "" });

const indices = [];
const letter = getLetter(i);
Expand Down
29 changes: 16 additions & 13 deletions public/vendor/pdf-lib.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/components/common.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script type="module">
pdfjsLib.GlobalWorkerOptions.workerSrc = '<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf.worker.min.mjs?4.6.82-legacy';
</script>
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf-lib.min.js?1.17.1"></script>
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf-lib.min.js?2.2.4"></script>
<script src="<?php echo $REVERSE_PROXY_URL; ?>/js/common.js?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/js/common.js") ?>"></script>
<script>
var trad = <?php echo json_encode([
Expand Down

0 comments on commit 6615556

Please sign in to comment.