Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg support #13

Open
hatja opened this issue Jun 29, 2023 · 2 comments
Open

svg support #13

hatja opened this issue Jun 29, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@hatja
Copy link

hatja commented Jun 29, 2023

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 hatja added the enhancement New feature or request label Jun 29, 2023
@zoey-kaiser
Copy link
Member

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!

@Sidebridge
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants