Select to view content in your preferred language

How do I create a screen print and then send it via e-mail with JavaScript?

2953
2
Jump to solution
05-14-2015 08:51 AM
ChrisSergent
Deactivated User

If an application is having a problem, I would like to allow the user to create a screen print on a mobile device, like an iPad and then send the image as an attachment using JavaScript. How do you do this?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
TomWayson
Esri Contributor

Typically people use http://html2canvas.hertzen.com/ to do this w/ JavaScript, BUT that doesn't work if your app includes images that came from another domain (i.e. tiles from a map service). You may be able to get around that if you want to run all your image requests through a proxy. Also, I have no idea what the support is like for mobile browsers. The one time tried html2canvas before on dojox/charting charts, they came out funky - so there may also be issues w/ SVG (read: feature layers), which may require you to inline any CSS styles. Because of those issues, I have not bothered trying it on a full page of an app.

I'd be interested to hear if anyone has successfully done this w/ a mapping app.

I'd say you are better off providing your users w/ links to instructions on how to take a screen shot in the various devices you support (like How to take a screenshot on an iPad (any generation) | Digital Trends ) and an e-mail address where they can send it.

View solution in original post

2 Replies
TomWayson
Esri Contributor

Typically people use http://html2canvas.hertzen.com/ to do this w/ JavaScript, BUT that doesn't work if your app includes images that came from another domain (i.e. tiles from a map service). You may be able to get around that if you want to run all your image requests through a proxy. Also, I have no idea what the support is like for mobile browsers. The one time tried html2canvas before on dojox/charting charts, they came out funky - so there may also be issues w/ SVG (read: feature layers), which may require you to inline any CSS styles. Because of those issues, I have not bothered trying it on a full page of an app.

I'd be interested to hear if anyone has successfully done this w/ a mapping app.

I'd say you are better off providing your users w/ links to instructions on how to take a screen shot in the various devices you support (like How to take a screenshot on an iPad (any generation) | Digital Trends ) and an e-mail address where they can send it.

ChrisSergent
Deactivated User

I found this to be a tough topic online. Thanks.

0 Kudos