Skip to content

Commit

Permalink
Fix trimming of final page when it's full
Browse files Browse the repository at this point in the history
  • Loading branch information
eKoopmans committed Jan 27, 2019
1 parent 7d7151a commit 0fe9726
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Worker.prototype.toPdf = function toPdf() {

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

0 comments on commit 0fe9726

Please sign in to comment.