web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Html canvas element in...
Power Apps
Unanswered

Html canvas element in pcf control

(0) ShareShare
ReportReport
Posted on by 4

Hi all,

 

I am trying to use HTML canvas element in pcf control by using typescript code. But, I cannot access canvas.toDataURL() function in pcf control. It gives me an error like:

Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

I have also tried

 var mapCanvas = document.createElement('canvas'as HTMLCanvasElement;
but it gives same error.Can someone tell me the solution of these? Is pcf support canvas element?
 
Thanks!
I have the same question (0)
  • v-yutliu-msft Profile Picture
    on at

    Hi @Shraddha113 ,

    Do you want to export image by using command like this: canvas.toDataURL("image/png")?

    If so, this is supported in pcf. The problem should be about your code.

    You need to set crossOrigin for the image outside the onload function.

    Here's a similar issue for your reference:

    https://stackoverflow.com/questions/43310565/failto-execute-todataurl-on-htmlcanvaselement

     

     

    Best regards,

  • Shraddha113 Profile Picture
    4 on at

    Hi,

    Yes. I have try this also but it still gives the same error. So, is there some other way?

  • v-yutliu-msft Profile Picture
    on at

    Hi @Shraddha113 ,

    Since I did not met the same problem before, I don't quite know where's the problem.

    I'm sorry that I am not quite familiar with pcf, I suggest you open a ticket here:

    https://powerapps.microsoft.com/en-us/support/pro/ticket/

     

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard