We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Exporting diagram results in error: Tainted canvases may not be exported.

I am trying to export and it was working fine but now it is telling me this when I try to export.

Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. What would cause this?

5 Replies

CC Chad Carey August 1, 2019 06:46 PM UTC

this seems ot have something to do with ImageElements, which is another problem I'm having (https://www.syncfusion.com/forums/146368/imageelement-doesn39t-always-show-images)

If the images are not loaded or not loading at all, export works. If the images load, even partially, the export breaks.


SG Shyam G Syncfusion Team August 2, 2019 11:21 AM UTC

Hi Chad, 
 
Query 
Response 
Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. What would cause this? 
 
If the images are not loaded or not loading at all, export works. If the images load, even partially, the export breaks.  
The image either should be hosted in an application or it should in same domain, so only the image will be exported. It is an behavior of JavaScript. Please refer to our help documentation. 
 
 
We have created a sample in which we have rendered an layout sample. The image rendered in layout is hosted in the application. 
 
 
 
 
 
Regards, 
Shyam G 



SG Shyam G Syncfusion Team August 2, 2019 11:34 AM UTC

Hi Chad, 
 
Please ignore our previous update 
 
Query 
Response 
Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. What would cause this? 
 
If the images are not loaded or not loading at all, export works. If the images load, even partially, the export breaks.  
The image either should be hosted in an application or it should in same domain, so only the image will be exported. It is an behavior of JavaScript. Please refer to our help documentation. 
 
 
We have created a sample in which we have rendered an layout sample. The image rendered in layout is hosted in the application. 
 
 
 
 
 
 
Regards, 
Shyam G 



CC Chad Carey August 2, 2019 12:56 PM UTC

I will test that. they were being pulled from a repository we have that is on a different domain than the ones I am testing with. thank you.


SG Shyam G Syncfusion Team August 5, 2019 04:18 AM UTC

Hi Chad, 
We will wait to hear from you. 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon