Closed FHoffmannSopra closed 3 years ago
In theory, classes are supported. Where are your styles defined? svg2pdf supports SVG style
, link
, and xml-stylesheet
tags. For link
and xml-stylesheet
tags you need to enable the loadExternalStylesheets option. Note, that styles in the HTML of your webpage are not picked up. The styles need to be defined or referenced in the SVG itself.
Works for me with my simple test: test it in Playground
Thanks for your superfast reply.
My styles are defined in a seperate css file, so they are not referenced in the Svg itself. I guess that is the issue in my case. So the key is to change the way I create the Svg.
Hey guys,
I tried to render a ccs-styled polyline with the svg2pdf tool.
<polyline points="125.5,112.55411200000003 125.5,142.55411200000003 125.5,212.62911200000002 126,212.62911200000002 126,282.704112 126,312.704112" fill="none" class="test"></polyline>
Whenever I use a css-class the polyline is not rendered at all. The css class is just a change to the color of the polyline, I wanted to make it as simple as possible.
I just need the info, if there is support for such statements at all, because in my case it is essential to use css classes to style my elements.
I am using svg2pdf 2.0.0 and jsPdf 2.0.0.
Thanks for your help Frederic