Saving webView HTML as an image

I would like users to be able to save an image of a graph that it created on an HTML page in a webView. I found out that since webView sits above the GL layer, it can’t simply be captured as a screenshot (from within the app).

Does anyone have any experience or think it might be possible to use something like html2canvas to create a canvas element and then do something like this?

var canvas = document.getElementById("mycanvas"); var img = canvas.toDataURL("image/png"); document.write('\<img src="'+img+'"/\>');

Would be a neat workaround to the problem, if possible.

another workaround is, do the graph in corona then take the screenshot normally.

@carloscosta Yeah, I thought about that too. I suppose the app could have a dialog box that asks the user to take a snapshot using the device’s own method and then open up something that would let them retrieve it via the camera roll. It would be nice to keep it all in the app, however. 

just for curiosity, what do you need the html file for? i usually only need html files when is maps related info. other than that i always do in corona.

another workaround is, do the graph in corona then take the screenshot normally.

@carloscosta Yeah, I thought about that too. I suppose the app could have a dialog box that asks the user to take a snapshot using the device’s own method and then open up something that would let them retrieve it via the camera roll. It would be nice to keep it all in the app, however. 

just for curiosity, what do you need the html file for? i usually only need html files when is maps related info. other than that i always do in corona.