Skip to content

Commit c68d042

Browse files
authored
Merge pull request #1354 from zbjornson/zb/pdfstream-meta
Pass metadata to PDF stream function
2 parents 1936282 + 9d25114 commit c68d042

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1010
### Changed
1111
### Added
1212
### Fixed
13+
* PDF metadata (added in 2.3.0) wasn't being set with `canvas.createPDFStream()`
1314

1415
2.3.1
1516
==================

lib/pdfstream.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ var util = require('util');
2727
* @api public
2828
*/
2929

30-
var PDFStream = module.exports = function PDFStream(canvas) {
30+
var PDFStream = module.exports = function PDFStream(canvas, options) {
3131
if (!(this instanceof PDFStream)) {
3232
throw new TypeError("Class constructors cannot be invoked without 'new'");
3333
}
3434

3535
Readable.call(this);
3636

3737
this.canvas = canvas;
38+
this.options = options;
3839
};
3940

4041
util.inherits(PDFStream, Readable);
@@ -54,5 +55,5 @@ PDFStream.prototype._read = function _read() {
5455
} else {
5556
self.push(null);
5657
}
57-
});
58+
}, this.options);
5859
};

0 commit comments

Comments
 (0)