yWorks / svg2pdf.js

A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
MIT License
654 stars 100 forks source link

Incorrect rendering of svg on some attributes #130

Closed arturasn closed 3 years ago

arturasn commented 4 years ago

Some elements of the SVG are rendered incorrectly compared the html and pdf generated version of the svg2pdf.js I have made a jsFiddle to reproduce the errors: link I expect the SVG in the pdf look the same as in html, however currently this is not the case. Issues from what I see(maybe exists more):

  1. Gradient is not used (I have played with this a little bit and not ommiting default values(x1="0%" y1="0%" x2="100%" y2="0%") seem to fix this however it should work regardless.
  2. Vertical text incorrect positioning
  3. Text and line in the center lifted up higher than expected
HackbrettXXX commented 4 years ago

Thank you for the bug report.

arturasn commented 3 years ago

2) Vertical text incorrect positioning 3) Text and line in the center lifted up higher than expected

I see that with the newest version of svg2pdf.js(in online playground) the 2, 3 issues seem to be fixed. Will the percentage values be supported at any stage?

HackbrettXXX commented 3 years ago

Percentage values would be implemented in the context of #154. We currently don't plan to implement it on our own but we will merge pull requests from the community.

I'm closing this since 2 & 3 are fixed and 1 will be tracked by #154.