From 0eae89663391e40569f5f16c5d9206e2ed266660 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Wed, 22 Jan 2025 14:12:01 +0000 Subject: [PATCH] Fix pagebreaks when explicit width set --- src/plugin/pagebreaks.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugin/pagebreaks.js b/src/plugin/pagebreaks.js index 5a4dc2b..e6550b5 100644 --- a/src/plugin/pagebreaks.js +++ b/src/plugin/pagebreaks.js @@ -41,6 +41,8 @@ Worker.prototype.toContainer = function toContainer() { // Setup root element and inner page height. var root = this.prop.container; var pxPageHeight = this.prop.pageSize.inner.px.height; + var ratio = this.prop.src.clientWidth / this.prop.pageSize.inner.px.width; + pxPageHeight *= ratio; // Check all requested modes. var modeSrc = [].concat(this.opt.pagebreak.mode);