tags:

views:

130

answers:

2

I've got an idea for a site that would generate png or jpeg screenshots of webpages on the fly. The end user would never see the pages, but the HTML would be turned into a screenshot instead and the end user would see that screenshot.

How can I get started on this? I guess what I'm looking for is some kind of PHP function that takes the HTML as an argument and then produces an image file in a specified location.

+1  A: 

As far as I know, PHP does not do this.

You can, however, find a solution using external tools. Here is how I would do it

  1. Generate the HTML
  2. I would pass this HTML to a external tool using exec. There is, for instance this one.
  3. Then, display the generated picture
Benoit Vidis