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,544
  • 8
  • 40
  • 62

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
  • 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:

  1. create screenshot using canvas
  2. convert the canvas screenshot to a JPG file
Community
  • 1
  • 1
Kae Verens
  • 3,983
  • 3
  • 20
  • 40