Skip to content

Commit

Permalink
use copyPages not embedPDF
Browse files Browse the repository at this point in the history
  • Loading branch information
acestronautical committed Mar 8, 2024
1 parent e0bb9ff commit f3cc231
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,25 +371,25 @@ export class Book {
for (const sig of signatures) {
// Adding pages to aggregate PDFs has to be done in order, not with promises
if (aggregate.front) {
const copiedPages = await aggregate.front.embedPdf(
const copiedPages = await aggregate.front.copyPages(
sig.front,
sig.front.getPageIndices()
);
copiedPages.forEach((page) => aggregate.front.addPage().drawPage(page));
copiedPages.forEach((page) => aggregate.front.addPage(page));
}
if (aggregate.back) {
const copiedPages = await aggregate.back.embedPdf(
const copiedPages = await aggregate.back.copyPages(
sig.back,
sig.back.getPageIndices()
);
copiedPages.forEach((page) => aggregate.back.addPage().drawPage(page));
copiedPages.forEach((page) => aggregate.back.addPage(page));
}
if (aggregate.duplex) {
const copiedPages = await aggregate.duplex.embedPdf(
const copiedPages = await aggregate.duplex.copyPages(
sig.duplex,
sig.duplex.getPageIndices()
);
copiedPages.forEach((page) => aggregate.duplex.addPage().drawPage(page));
copiedPages.forEach((page) => aggregate.duplex.addPage(page));
}
}
if (aggregate.front) {
Expand Down

0 comments on commit f3cc231

Please sign in to comment.