nuxt-pdf icon indicating copy to clipboard operation
nuxt-pdf copied to clipboard

svg support

Open hatja opened this issue 2 years ago • 2 comments

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

hatja avatar Jun 29 '23 09:06 hatja

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:

  • Native support to parse it in the background
  • Offer a composable to encapsulate the code provided above

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

zoey-kaiser avatar Feb 14 '24 07:02 zoey-kaiser

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

Sidebridge avatar Jul 04 '24 01:07 Sidebridge