question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better support for multiple canvases to be created

See original GitHub issue

html2canvas can be a slow if you need to make a canvases for multiple items, because the whole document needs cloned multiple times, it would be nice to have a way to send multiple items to be converted to canvas.

Few different ways would suffice

  • Pass a collection of node to create canvases for, then the promise would return an array
var nodes = [];
// fill nodes
html2canvas(nodes).then(function(canvases){
// use canvases
});
  • Piggy back the removeContainer option and allow you to reference an iframe to operate on in the options. This gives a greater amount of flexibility to the end user
var nodes = [];
// fill nodes
var iframe;
html2canvas(node[0], {removeContainer: false}).then(function(canvas, iframe){
// use canvas
iframe = $(iframe).attr('id');
});
html2canvas(node[1], {removeContainer: true, iframe: iframe})then(function(canvas){
// use canvas
});

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:12
  • Comments:24 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
codingedgarcommented, Sep 23, 2021

💡 Without touching the library, a workaround could be to make a Texture Atlas, call html2canvas over a div, get the resulting canvas and crop it accordingly to produce multiple canvases.

1reaction
chenyiqiaocommented, Jul 16, 2020

The bounty for this is still open for the taking…

$50 might not be enough 😆

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should I have multiple canvases in the same scene?
In my experience, multiple canvases are not required for most situations. Better to have a single canvas and simply use multiple panels ...
Read more >
Is it better to stack multiple canvases in DOM or control all ...
Right, but the answer really is that it depends. Each specific use case is different. Certainly using more canvases equates to more rendering ......
Read more >
Solved: Add Multiple Canvases to an Entity Form
Solved: I need to include two canvases within the same entity form. Has anyone figured this out yet? Doing one canvas app that...
Read more >
Three.js Multiple Canvases Multiple Scenes
One more solution would be to render to an off screen canvas and copy the result to a 2D canvas at each element....
Read more >
VPython for Beginners 31 - Multiple Canvases - YouTube
You can run multiple animations at once in separate frames using the canvas function. Support this channel: http://ko-fi.com/LetsCodePhysics, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found