I will create a dynamic page with content added and rearranged by JavaScript. Is it possible to create a jpg image of this content? - let's say, everything that is inside the container div will be generated to an image. If so, could anyone give me some good tips of this technique?
2 Answers
The traditional method is to run a "headless browser" on your server, "browse" to that url, and take a screenshot. It can be done to some accuracy on the client side in HTML5 browser, see this discussion:
Comments
This question may help: Using HTML5/Canvas/JavaScript to take screenshots
and then this one: convert canvas to jpeg image
The sequence of your algorithm would be something like:
- create screenshot using canvas
- convert the canvas screenshot to a JPG file