sidebase / nuxt-pdf

📄 A easy to use, pdf exporting module to convert Nuxt 3 components into downloadable PDFs.
MIT License
112 stars 10 forks source link

svg support #13

Open hatja opened 1 year ago

hatja commented 1 year ago

Describe the feature

I noticed that currently svgs are not shown in the pdf. Im trying export a d3js chart and a table, but the chart doesnt appear. Would be nice if the package could handle svgs as well.

Additional information

No response

zoey-kaiser commented 7 months ago

Currently you would need to parse the SVG yourself and convert it into a base64 image beforehand. You can find some information on how to do this here: https://stackoverflow.com/questions/27706956/render-svg-to-pdf-using-jspdf/35788928#35788928

Otherwise I think it makes sense to extend jsPDF and offer this inside our module via:

If this is still relevant for you (as it have been a while, sorry for the delay). I could look into adding this!

Sidebridge commented 3 months ago

Please this is very relevant for my use case. Especially with the fact that I am using svg icons from https://icones.js.org/