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

When there is a large DOM content, empty file download happening. Are there any limitations? #466

Open
2 tasks
santhosh-j opened this issue Oct 30, 2023 · 3 comments

Comments

@santhosh-j
Copy link

santhosh-j commented Oct 30, 2023

When there is a large DOM content, empty file download happening. Are there any limitations?

I am using Angular and high charts. I tried with DOM containing 200+ highchart images and static svg files. When tried to download the dom as JPEG, it is giving empty images as result.
Is there any limitation for this package?
stackblitz code
https://stackblitz.com/edit/angular-12-highcharts-e132vd

Expected behavior

Download whole dom as image

Actual behavior

Downloading empty Image as 0B size

Library version

https://www.npmjs.com/package/dom-to-image/v/2.6.0

Browsers

  • Chrome 118
  • Firefox 119
@richex-cn
Copy link

Looks like a cross-domain problem, See https://stackoverflow.com/a/49994161

image

@santhosh-j
Copy link
Author

Looks like a cross-domain problem, See https://stackoverflow.com/a/49994161

image

This will not be an issue since in the same code, if you reduce the totalNumberOfCharts value from 200 to 100, the image will download properly. When the DOM size increases, download not happening.

@richex-cn
Copy link

I tried to display canvas on the page, and it looked like this:

image

And canvas size is 790x74606, This seems to be related to low memory, I'm not familiar with Angular, so maybe you could try remerging by batch rendering?

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

No branches or pull requests

2 participants