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

Not rendering and broken pdf with `font-size="smaller"` #103

Closed bernhardreiter closed 5 years ago

bernhardreiter commented 5 years ago

Trying to render an svg, some elements are not rendered correctly. Ideas is the rotate of the "Sum of days" Using 100f3c6f83980811f9ae4dc32e8830983ab03b64 (HEAD -> master)

bernhardreiter commented 5 years ago

test103-bad.pdf test103.html.txt

HackbrettXXX commented 5 years ago

The issue is font-size="smaller". We only support pixel values here. So this is kind of a duplicate of #101.

bernhardreiter commented 5 years ago

When used in our vuejs application with this SVG the application is send in an endless loop. This should not happen, even if some feature is not supported. Update: this endless loop maybe about something else, it seems this issue just covered it.

(#95 which is closed by #101 is about different measurement units in the jsPDF object, if font-size="smaller" is the problem, it would be about unsupported relative units.)

bernhardreiter commented 5 years ago

Confirmation from my side that replacing "smaller" with "9" will lead to the full SVG rendered in chromium and rendered at all in a libpoppler based viewer!

So this is a known issue of "not supporting most other units than px (or pt for that matter)" mentioned in #82.

@HackbrettXXX thanks for your hint!

HackbrettXXX commented 5 years ago

(#95 which is closed by #101 is about different measurement units in the jsPDF object, if font-size="smaller" is the problem, it would be about unsupported relative units.)

Sorry I meant #100

I'm closing this as a duplicate of #100.

bernhardreiter commented 5 years ago

The difference between #100 and this one is that in case of "1em" there is still a text seen and a valid pdf. But I guess that "em" will have the same problem, so it is close enough.