From 76bb600263ef0e8b82dc1599e0b2bae5edd2998b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pa=C4=BEo?= Date: Wed, 7 Sep 2016 16:49:57 +0200 Subject: [PATCH 1/2] PDFKit: Add layout property and fix margin/margins --- pdfkit/pdfkit-tests.ts | 6 +++++- pdfkit/pdfkit.d.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pdfkit/pdfkit-tests.ts b/pdfkit/pdfkit-tests.ts index a21dfed815dbb5..86d6bc7e2ece86 100644 --- a/pdfkit/pdfkit-tests.ts +++ b/pdfkit/pdfkit-tests.ts @@ -24,7 +24,7 @@ doc.addPage({ }); doc.addPage({ - margin: { + margins: { top: 50, bottom: 50, left: 72, @@ -32,6 +32,10 @@ doc.addPage({ } }); +doc.addPage({ + layout: "landscape" +}); + doc.info.Title = "Sample"; doc.info.Author = "kila Mogrosso"; diff --git a/pdfkit/pdfkit.d.ts b/pdfkit/pdfkit.d.ts index 70836187e281f1..85d53c4462e3c0 100644 --- a/pdfkit/pdfkit.d.ts +++ b/pdfkit/pdfkit.d.ts @@ -231,7 +231,9 @@ declare namespace PDFKit { info?: DocumentInfo; autoFirstPage?: boolean; size?: number[]; - margin?: { top: number; left: number; bottom: number; right: number }|number; + margin?: number; + margins?: { top: number; left: number; bottom: number; right: number }; + layout?: "portrait" | "landscape" bufferPages?: boolean; } From dff108db9a96da9c8f3dcb489b57b389d0f100b3 Mon Sep 17 00:00:00 2001 From: Dominik Palo Date: Fri, 9 Sep 2016 22:15:34 +0200 Subject: [PATCH 2/2] Add missing semicolon --- pdfkit/pdfkit.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfkit/pdfkit.d.ts b/pdfkit/pdfkit.d.ts index 85d53c4462e3c0..30c8d138daa355 100644 --- a/pdfkit/pdfkit.d.ts +++ b/pdfkit/pdfkit.d.ts @@ -233,7 +233,7 @@ declare namespace PDFKit { size?: number[]; margin?: number; margins?: { top: number; left: number; bottom: number; right: number }; - layout?: "portrait" | "landscape" + layout?: "portrait" | "landscape"; bufferPages?: boolean; }