From 330756313e80a33769414273a1c45dbe6de1ec06 Mon Sep 17 00:00:00 2001 From: ringotc Date: Tue, 17 Oct 2023 20:01:55 -0700 Subject: [PATCH] fix the transform behavior of addPage function --- lib/document.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/document.js b/lib/document.js index 61f2a10d..1b2d5d2a 100644 --- a/lib/document.js +++ b/lib/document.js @@ -159,9 +159,10 @@ class PDFDocument extends stream.Readable { // flip PDF coordinate system so that the origin is in // the top left rather than the bottom left - this._ctm = [1, 0, 0, 1, 0, 0]; + this.transform(1, 0, 0, -1, 0, this.page.height); - + this._ctm = [1, 0, 0, 1, 0, 0]; + this.emit('pageAdded'); return this;