Open laszlo1337 opened 9 months ago
Can you test with v0.15 and a browser app using webpack (https://github.com/foliojs/pdfkit/tree/master/examples/webpack)?
Currently the docs build system is broken, so (https://pdfkit.org/demo/browser.html) is outdated
Bug Report
Description of the problem
I have created working example of drawing SVG path into pdf using PDFKit browser sandbox (https://pdfkit.org/demo/browser.html) The problem is, while it's working perfectly here, the same code ported to server environment produces different results. The exact issue is within
translate
function, which translates the SVG path way too much (mathematically incorrectly). I assume the units would be at fault? Attaching expected result from browser sandbox and result produced by the same code on the server (the same code minus blobStream code of course) (set the one from the browser as blue color) 4282dfc2-f3f1-4399-9ec4-191e59185540.pdf 2SFtR3p2.pdfEDIT: Also just discovered, when drawing rect and then drawing the path, it works as expected in the browser, but on the server the drawn rect is drawn OVER the path, even though the order of drawing is preserved. To test, place
doc.save().rect(0, 0, totalSize, totalSize).fill('#00FF00').restore()
just before path drawing result when rendered on the server: 5Hl7kt4n.pdf result from browser sandbox: 8b7edae8-0a0c-412d-8fa9-4412d5963b9d.pdfCode sample
Your environment