Skip to content

Commit 0fe9726

Browse files
committed
Fix trimming of final page when it's full
1 parent 7d7151a commit 0fe9726

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Worker.prototype.toPdf = function toPdf() {
195195

196196
for (var page=0; page<nPages; page++) {
197197
// Trim the final page to reduce file size.
198-
if (page === nPages-1) {
198+
if (page === nPages-1 && pxFullHeight % pxPageHeight !== 0) {
199199
pageCanvas.height = pxFullHeight % pxPageHeight;
200200
pageHeight = pageCanvas.height * this.prop.pageSize.inner.width / pageCanvas.width;
201201
}

0 commit comments

Comments
 (0)