0

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?

user1121487
  • 2,662
  • 8
  • 42
  • 63

2 Answers2

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:

Using HTML5/Canvas/JavaScript to take screenshots

Community
  • 1
  • 1
Not_a_Golfer
  • 47,012
  • 14
  • 126
  • 92
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:

  1. create screenshot using canvas
  2. convert the canvas screenshot to a JPG file
Community
  • 1
  • 1
Kae Verens
  • 4,076
  • 3
  • 21
  • 41