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?
Asked
Active
Viewed 841 times
2 Answers
1
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:
Community
- 1
- 1
Not_a_Golfer
- 43,930
- 13
- 122
- 88
1
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
Community
- 1
- 1
Kae Verens
- 3,983
- 3
- 20
- 40