Ability to generate an image from a web page?

I’m not sure if this is a PHP question. But I have no idea if or how this might be accomplished. But basically what I’d like to do is to create a page with some specially formatted text on it and from that generate a png (or maybe jpg). And I’d need to be able to set the width and height of the image to generate.

So basically, load up a web page with your browser set to something like 500x800 and then create a png of it.

Any ideas what I should look for to do something like this?

Thanks,

-David

Why not use GD or Imagemagick to create the image straight away?
Imagemagick now has access to Pango if setup with the delegate.
Pango and imagemagick
Pango website

You could do something like that with imagecreate:

http://php.net/manual/en/function.imagecreate.php

I’ll take a look at that. But basically what the page I want to create an image from will have is a background set with CSS, and some text with special styles applied to it that include font-face and are also sized dynamically with javascript (fitText). So basically I’m trying to create a sort of “work of art” dynamically with CSS and Javascript. And then take a picture of it.

I think Imagemagick can do it but you need to use an X server whatever that is!

Check out the Imagemagick forum - I did find this script but I have not used it: http://www.imagemagick.org/Usage/scripts/snapshot_webpages

You would probably need to capture the whole page then crop the part you want.

I think I would load the page and use something like Greenshot or another program designed to create images from your monitor screen. You can use the program to highlight the specific part of the screen that you want, eliminating the browser borders, toolbars, etc.