Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit b1a15b2

Browse files
committed
Remove deprecated methods from document
1 parent 5f42512 commit b1a15b2

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

lib/document.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ By Devon Govett
44
*/
55

66
import stream from 'stream';
7-
import fs from 'fs';
87
import PDFObject from './object';
98
import PDFReference from './reference';
109
import PDFPage from './page';
@@ -205,30 +204,6 @@ class PDFDocument extends stream.Readable {
205204
}
206205
}
207206

208-
write(filename, fn) {
209-
// print a deprecation warning with a stacktrace
210-
const err = new Error(`\
211-
PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. \
212-
Please pipe the document into a Node stream.\
213-
`
214-
);
215-
216-
console.warn(err.stack);
217-
218-
this.pipe(fs.createWriteStream(filename));
219-
this.end();
220-
return this.once('end', fn);
221-
}
222-
223-
output(fn) {
224-
// more difficult to support this. It would involve concatenating all the buffers together
225-
throw new Error(`\
226-
PDFDocument#output is deprecated, and has been removed from PDFKit. \
227-
Please pipe the document into a Node stream.\
228-
`
229-
);
230-
}
231-
232207
end() {
233208
this.flushPages();
234209
this._info = this.ref();

0 commit comments

Comments
 (0)