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
649 stars 98 forks source link

Incorrect position of text compared with other text inside pdf #159

Open arturasn opened 3 years ago

arturasn commented 3 years ago

Some elements of the SVG are rendered incorrectly compared the html and pdf generated version of the svg2pdf.js. Rotated text(I character) incorrectly aligned with APART1 text middle: link

arturasn commented 3 years ago

Examples where incorrect positioning is more likely seen: link

yGuy commented 3 years ago

Seems like dominant-baseline="text-before-edge" is the unsupported attribute. That's a known issue, I guess. So this seems like a duplicate of #80

arturasn commented 3 years ago

Seems to be alignment-baseline="text-before-edge" also unsupported, so it is not only an issue of dominant-baseline. link

yGuy commented 3 years ago

Yes, see #109 and this comment: https://github.com/yWorks/svg2pdf.js/pull/114#pullrequestreview-307052649 - this is a missing feature in jspdf, already, as far as I can tell.