tpisto / pdf-fill-form

Fill PDF forms and return either filled PDF or PDF created from rendered page images.
MIT License
227 stars 48 forks source link

Allow source to come in a a buffer an not a filename #71

Closed dfharmon closed 4 years ago

dfharmon commented 5 years ago

This adds Sync methods for reading and writing using a stream buffer as the source. The first param for each is the stream buffer which can be accessed via rs.readFileSync()

await PdfFillForm.readBuffer(fs.readFileSync('test.pdf'));
await PdfFillForm.writeBuffer(fs.readFileSync('test.pdf'), { "myField": "myField fill value" }, { "save": "pdf", 'cores': 4, 'scale': 0.2, 'antialias': true } );
tpisto commented 4 years ago

Thank you for your contribution!