exupero / saveSvgAsPng

Save SVGs as PNGs from the browser.
MIT License
1.09k stars 362 forks source link

unable to download text and table data using savesvgaspng . #222

Open Sanjotarm opened 4 years ago

Sanjotarm commented 4 years ago

i am able to download the graph using svgid, but unable to download text and table in same file(graph.png). I am using saveSvgaspng.js

downloader(){ saveSvgAsPng(svgid, 'graph.png', {scale:1}, {backgroundColor: transparent}); }

<button onclick={()=>this.downloader()}>Download

Please suggest any thing need to add to get text and table data.

ligaz commented 4 years ago

Hey @Sanjotarm,

Can you please elaborate on your scenario? Is the text and table data part of the SVG itself or those are separate HTML elements?

It would be great if you could provide a more complete example as well.

ligaz commented 4 years ago

You would have to build this on your own. This library allows only for exporting SVG elements. This yields that you have two options:

Sanjotarm commented 4 years ago

hi @ligaz ,

i have tried with dom-to-image library. But i am unable to see table data with exact UI, Once downloading png its compressing the downloaded page(Entire data will display in one page without scroll.).

So please can you suggest if any other library for pdf downloader with text, svg and table data.

i have tried with html2canvas, but svg is downloading with black backgorund color.

So please can you help out to resolve the problem.

ligaz commented 4 years ago

It looks like your request exceeds the realm of this project. My suggestion is to post your question on StackOverflow where you will get relevant responses.