Open jmbluethner opened 1 month ago
Just for reference I'm adding the part from the API endpoint which is responsible for encoding the output()
data back into a PDF file. req.body.doc
is the data from output()
// [...]
const writer = fs.createWriteStream(uploadDirectory + '' + fileName);
writer.write(req.body.doc)
writer.end();
// [...]
Found the solution.
I had to add the correct encoding in fs.createWriteStream()
const writer = fs.createWriteStream(uploadDirectory + '' + fileName, {encoding: 'binary'});
Hey there 👋
I'm currently working on my first jsPDF project, and it's going great, accept for one issue ...
On the clientside, I'm generating a PDF which then gets sent to a local REST API. Saving the PDF locally, using the
save()
method works fine and I get my beautiful PDF. However, after sending it to the API using theoutput()
method, the Barcode TTF is lost and the png on the top right corner looks super weird as well.PDF from
save()
PDF from
output()
Might the problem be, that neither the custom ttf nor the png are being embedded to the PDF? If so, how would I change that? Or is it something different?
Any advice would be highly appreciated!
Thanks in advance and best regards 😊