yWorks/svg2pdf.js

Support for XML

Stefanuk12 opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
Currently, you must use an SVG element to use this package. This means if you are trying to do this with nodejs/on the server, you need to create a "pseudo-element" which I'm not sure would even work.

Describe the solution you'd like
The function to support either an element or a string

Describe alternatives you've considered
Use a "pseudo-element" for the SVG

yGuy commented

This is not at all feasible with the current implementation as the it requires a working DOM and JavaScript API for the SVG, CSS, and Canvas.

To the best of my knowledge this does not exist for node.js as a pure JS implementation (the stubs that exist in Jest are a joke and don't work at all - about 99.9% of the implementation is missing). Use a headless browser like Puppeteer instead if you want to work with SVG on the server in JavaScript.