html2canvas icon indicating copy to clipboard operation
html2canvas copied to clipboard

Html2Canvas doesnt render images when capturing Iframes

Open HamadUllah16 opened this issue 4 months ago • 3 comments

When have some html rendered in iframe and we are trying to capture it with html2canvas but the images seems to be broken always? anyone have been able to figure this out?

HamadUllah16 avatar Sep 01 '25 13:09 HamadUllah16

Is it possible that the iframe hasn't fully loaded? I have also encountered the same problem before, because the iframe is lazy to load and must be fully loaded, or maybe other plugins are used in the iframe, which may cause the plugin position to turn black.

mnjwh156-tech avatar Sep 17 '25 12:09 mnjwh156-tech

Is it possible that the iframe hasn't fully loaded? I have also encountered the same problem before, because the iframe is lazy to load and must be fully loaded, or maybe other plugins are used in the iframe, which may cause the plugin position to turn black.

Hey, found the solution. You need to pass base64 string of the images to the iframe.

HamadUllah16 avatar Sep 19 '25 04:09 HamadUllah16

Is it possible that the iframe hasn't fully loaded? I have also encountered the same problem before, because the iframe is lazy to load and must be fully loaded, or maybe other plugins are used in the iframe, which may cause the plugin position to turn black.

Hey, found the solution. You need to pass base64 string of the images to the iframe.

Can you share the implementation? thanks

coderhaooo avatar Nov 12 '25 15:11 coderhaooo