mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
format: Resize based on rotation
This commit is contained in:
parent
31a17d7bb4
commit
08f15b0dbb
1 changed files with 8 additions and 1 deletions
|
|
@ -643,7 +643,14 @@ async function save(order) {
|
|||
pdfPage.setRotation(window['PDFLib'].degrees(parseInt(rotation)));
|
||||
}
|
||||
if(format) {
|
||||
resizePage(pdfPage, mm2points(parseInt(format.split("x")[0])), mm2points(parseInt(format.split("x")[1])));
|
||||
let width = mm2points(parseInt(format.split("x")[0]));
|
||||
let height = mm2points(parseInt(format.split("x")[1]));
|
||||
|
||||
if(pdfPage.getHeight() > pdfPage.getWidth()) {
|
||||
resizePage(pdfPage, Math.min(height, width), Math.max(height, width));
|
||||
} else {
|
||||
resizePage(pdfPage, Math.max(height, width), Math.min(height, width));
|
||||
}
|
||||
}
|
||||
pdf.addPage(pdfPage);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue