From 4d02fff04e122130171b616f4d87da40cea9e96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Am=C3=A9rico?= Date: Thu, 6 Jun 2019 19:17:50 -0300 Subject: [PATCH] Remove deprecated method PDFDocument.output --- CHANGELOG.md | 1 + lib/document.js | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 325ad15..21cbb36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Fix links to pages within the document - Add support for named destinations - Throw errors when `dash(...)` is passed invalid lengths +- Remove PDFDocument#output method ### [v0.9.1] - 2019-04-30 diff --git a/lib/document.js b/lib/document.js index c895efb..7143bc2 100644 --- a/lib/document.js +++ b/lib/document.js @@ -179,7 +179,7 @@ class PDFDocument extends stream.Readable { if (args.length === 0) { args = ['XYZ', null, null, null]; } - if ((args[0] === 'XYZ') && (args[2] !== null)) { + if (args[0] === 'XYZ' && args[2] !== null) { args[2] = this.page.height - args[2]; } args.unshift(this.page.dictionary); @@ -232,14 +232,6 @@ Please pipe the document into a Node stream.\ return this.once('end', fn); } - output(fn) { - // more difficult to support this. It would involve concatenating all the buffers together - throw new Error(`\ -PDFDocument#output is deprecated, and has been removed from PDFKit. \ -Please pipe the document into a Node stream.\ -`); - } - end() { this.flushPages(); this._info = this.ref();