0

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?

5
  • 1
    can u elaborate your question, i didnt understand generate an image from an div with all inner elements ? Commented Apr 4, 2013 at 10:41
  • 1
    I think he wants to render a piece of HTML and save it as an image using JSF or JS. Commented 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 :O Commented Apr 4, 2013 at 10:43
  • @4ndro1d If you don't need to generate the image programmatically then just PrtScrn. Commented Apr 4, 2013 at 10:50
  • Problem is that PDF isnt able to render my gradients Commented Apr 4, 2013 at 10:58

1 Answer 1

2

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/

Sign up to request clarification or add additional context in comments.

3 Comments

How should I convert it into a canvas?
@4ndro1d: The library html2canvas will do the trick. please follow the link
pastebin.com/Ls5Z6QE6 "The script doesn't render plugin content such as Flash or Java applets."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.