Skip to content

Commit

Permalink
Merge pull request #150 from cnotin/patch-1
Browse files Browse the repository at this point in the history
Generate landscape pages as landscape PDF
  • Loading branch information
rwv authored Nov 9, 2023
2 parents 24ef0c7 + 5b21bd7 commit 65628fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/images-to-pdf/images-to-pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export async function imagesToPDF(
const physicalWidth = width / dpi;
const physicalHeight = height / dpi;
const format = getImageFormat(blob);
const orientation = physicalWidth > physicalHeight ? "l" : "p";

doc.addPage([physicalWidth, physicalHeight]);
doc.addPage([physicalWidth, physicalHeight], orientation);
doc.addImage(buffer, format, 0, 0, physicalWidth, physicalHeight);
}

Expand Down

0 comments on commit 65628fa

Please sign in to comment.