Please make sure you are testing with the latest release of html2canvas.
Old versions are not supported and issues reported for them will be closed.
Between version 1.0.0 rc1 and 1.0.0 rc2 html2canvas stopped being able to include fonts and images in a saved screenshot with ForeignObjectRendering set as true.
In the network tab I can see the fonts and the images being fetched but they are not included in the final result.
This is the code that I'm using:
html2canvas(document.querySelector("#capture"), {foreignObjectRendering: true, logging: false, proxy: '/proxy'}).then(canvas => {
download(canvas.toDataURL('image/png'), "screenCapture.png", "image/png"); //download.js used here
});
Yes, if ForeignObjectRendering is configured as true, images are not working (local or not)... this is a mayor bug.
I've made an online example for this: https://playcode.io/482330?tabs=index.html,preview,console
Hey guys, there is a workaround to this issue, just simply convert the image to base64 format. The package couldn't render images but it can draw. Besides base64, you can also try svg format. Hope this helps!
Most helpful comment
Yes, if ForeignObjectRendering is configured as true, images are not working (local or not)... this is a mayor bug.
I've made an online example for this: https://playcode.io/482330?tabs=index.html,preview,console