Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

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

Open
Sanjotarm opened this issue May 27, 2019 · 4 comments
Open

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

Sanjotarm opened this issue May 27, 2019 · 4 comments

Comments

@Sanjotarm
Copy link

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
Copy link
Contributor

ligaz commented May 28, 2019

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
Copy link
Contributor

ligaz commented May 28, 2019

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

  • Augment the SVG with additional data (text, table data, etc.). Export the SVG. Then remove the augmented elements from the SVG.
  • Use dom-to-image library.

@Sanjotarm
Copy link
Author

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
Copy link
Contributor

ligaz commented May 29, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants