wjonesusna2012
wjonesusna2012
Upon further testing, this actually works if you specify 'ascii' as the encoding type in the writeFilieSync function. The default is utf-8 per the node docs. `fs.writeFileSync('test.pdf', pdf.output(), 'ascii')` works...
> @wjonesusna2012 , I see the same issue. > > However in my case I'm trying to return the output from node. > > ``` > const myPDF = doc.output()...
This issue is not stale. There are outstanding issues with how buffers work with this package.
@Mmferry Yes and no. If you scroll up on this thread on Sep 19, 2022 I posted the follow work-around: const docOutput = doc.output('arraybuffer'); const docBuffer = Buffer.from(docOutput, 'ascii'); res.status(200)...
So let me update this a little bit as I have found the source of the issue. If you follow the guide above, it tells you in the link to...