From 9d251149ab69e74a3d3372e836952411bc15d130 Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Mon, 14 Jan 2019 14:45:09 -0800 Subject: [PATCH] Pass metadata to PDF stream function I forgot to commit this file with #1345 :(. --- CHANGELOG.md | 1 + lib/pdfstream.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca20c158..cb40d62a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Changed ### Added ### Fixed +* PDF metadata (added in 2.3.0) wasn't being set with `canvas.createPDFStream()` 2.3.1 ================== diff --git a/lib/pdfstream.js b/lib/pdfstream.js index 837a034c3..99229703b 100644 --- a/lib/pdfstream.js +++ b/lib/pdfstream.js @@ -27,7 +27,7 @@ var util = require('util'); * @api public */ -var PDFStream = module.exports = function PDFStream(canvas) { +var PDFStream = module.exports = function PDFStream(canvas, options) { if (!(this instanceof PDFStream)) { throw new TypeError("Class constructors cannot be invoked without 'new'"); } @@ -35,6 +35,7 @@ var PDFStream = module.exports = function PDFStream(canvas) { Readable.call(this); this.canvas = canvas; + this.options = options; }; util.inherits(PDFStream, Readable); @@ -54,5 +55,5 @@ PDFStream.prototype._read = function _read() { } else { self.push(null); } - }); + }, this.options); };