I am looking for a tool, with which I can render a an div with all inner elements and save it as an image. There is no PHP running on the Server, only Java Server Faces and some Javascript Code. Is there any tool to do that with the given resources?
-
1can u elaborate your question, i didnt understand generate an image from an div with all inner elements ?dreamweiver– dreamweiver2013-04-04 10:41:34 +00:00Commented Apr 4, 2013 at 10:41
-
1I think he wants to render a piece of HTML and save it as an image using JSF or JS.iamdto– iamdto2013-04-04 10:43:02 +00:00Commented Apr 4, 2013 at 10:43
-
I built an preview of our Android application in HTML/CSS and I want to export this div (which contains an background image - the phone) and many other items in this div (icons, lists, etc) as an image @iamdto: Yeah that's exactly what I want :O4ndro1d– 4ndro1d2013-04-04 10:43:41 +00:00Commented Apr 4, 2013 at 10:43
-
@4ndro1d If you don't need to generate the image programmatically then just PrtScrn.maple_shaft– maple_shaft2013-04-04 10:50:10 +00:00Commented Apr 4, 2013 at 10:50
-
Problem is that PDF isnt able to render my gradients4ndro1d– 4ndro1d2013-04-04 10:58:02 +00:00Commented Apr 4, 2013 at 10:58
Add a comment
|
1 Answer
Convert the html to canvas first and then get the image of the canvas from the bitmapdata and then save it in the server side
This can be achieved through html2canvas http://html2canvas.hertzen.com/
3 Comments
4ndro1d
How should I convert it into a canvas?
Sano
@4ndro1d: The library html2canvas will do the trick. please follow the link
4ndro1d
pastebin.com/Ls5Z6QE6 "The script doesn't render plugin content such as Flash or Java applets."