diff --git a/lib/line_wrapper.js b/lib/line_wrapper.js index b1e05a3e..15f0ae53 100644 --- a/lib/line_wrapper.js +++ b/lib/line_wrapper.js @@ -310,7 +310,14 @@ class LineWrapper extends EventEmitter { return false; } - this.document.continueOnNewPage(); + const pageNum = this.document._pageBuffer.indexOf(this.document.page) + if(this.document.options.bufferPages && this.document._pageBuffer[pageNum + 1]) { + this.document.page = this.document._pageBuffer[pageNum + 1] + this.document.y = this.document.page.margins.top; + } else { + this.document.continueOnNewPage(); + } + this.column = 1; this.startY = this.document.page.margins.top; this.maxY = this.document.page.maxY();