html2canvas not working [multiple images on same div]
See original GitHub issue- You are using the latest version
- You are testing using the non-minified version of html2canvas and checked any potential issues reported in the console
Bug reports:
<div id="scream">
<img id="corps" class="corps" src="asset1.png"/>
<img id="visage" class="visage" src="asset2.png"/>
<img id="yeux" class="yeux" src="asset3.png"/>
</div>
when i select the div which includes multiple images: not working
// div select which include multiple images
html2canvas(document.querySelector("#scream")).then(canvas => {
document.body.appendChild(canvas)
});
// result: dont work
// Starting DOM parsing
// Added image asset1
// Added image asset2
// Added image asset3
// Added image
// Starting renderer
// Canvas renderer initialized (485x0 at 1542.9375,-13) with scale 0.5
// Finished rendering
// Nothing displayed
when i select one image from the div: working
// single image select
html2canvas(document.querySelector("#corps")).then(canvas => {
document.body.appendChild(canvas)
});
// result: works
// image loaded successfully
jsfiddle: https://jsfiddle.net/tfr59Ls1/
Specifications:
- vuejs : ^2.6.10,
- html2canvas version tested with: 1.0.0-rc.3
- Browser & version: chromium v73
- Operating system: Elementary Juno
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
why is html2canvas used in a loop not getting all the images in ...
I have a page with multiple report cards in separate div tags, each with a unique id. Each report card has a student...
Read more >I am trying to convert DIV to Image without HTML2CANVAS
I am recently trying to convert html to image in magento 1.9.2.4. so i have used Html2canvas.js. But It conflict with Magento Default ......
Read more >Convert HTML to Image in Jquery or JavaScript [Div or Table ...
For converting HTML to Image, we need to import one more javascript library, and it is HTML2CANVAS download it and import it into...
Read more >Features - html2canvas
Below is a list of all the supported CSS properties and values. background. background-clip (Does not support text ); background-color. background-image.
Read more >How to run the script on the page load instead of button clicked
Overview: I have two buttons on the page (Preview, Download), the basic functionality of the preview button is to capture the div elements...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mIcHyAmRaNe Seems to work as intended: https://jsfiddle.net/5fou1ctb/
The images are just getting blocked by CORS. Set “useCORS: true” and see the errors in the console. Also, your fiddle has a bug which prevents “capture” button from working.