Skip to content

Commit

Permalink
Updated to v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tanaikech committed Nov 26, 2023
1 parent e9ebbdc commit b5144e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PDFApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class PDFApp {
const pdfDoc = await self.PDFLib.PDFDocument.create();
for (let i = 0; i < data.length; i++) {
const pdfData = await self.PDFLib.PDFDocument.load(data[i]);
const pages = await pdfDoc.copyPages(pdfData, [...Array(pdfData.getPageCount())].map((_, i) => i));
const pages = await pdfDoc.copyPages(pdfData, pdfData.getPageIndices());
pages.forEach(page => pdfDoc.addPage(page));
}
const bytes = await pdfDoc.save();
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1007,4 +1007,8 @@ function sample2() {

1. A new method of `insertHeaderFooter` was added. [Ref](#insertheaderfooter) When this method is used, the custom header and footer can be added when a Google Spreadsheet is exported as PDF.

- v1.0.3 (November 26, 2023)

1. From [this discussion](https://github.com/Hopding/pdf-lib/issues/252), I changed the logic of the method `mergePDFs`. The method for using `mergePDFs` and the output are not changed. With this modification, the large PDF data can be merged.

[TOP](#top)

0 comments on commit b5144e8

Please sign in to comment.