HTML describes how a web browser should render a page. Whatever you come up with is going to have to have all of the functionality of a web browser, as well as the ability to render to an image file. You might be able to use GD as the final rendering engine, but there will be a lot of processing of data in between, such as rendering fonts, fetching inline images, handling javascript, possibly Java Applets, interpreting CSS, and probably other stuff I haven't though of.
It will probably be easier to craft some kind of script that launches an existing browser, and uses X-based tools to capture the browser window content to an image file. That, too, will have problems, unless you only capture pages that can be rendered within the dimensions of your X server. Perhaps a virtual X server, such as Xvfb can help with that.
A few standard applications that could get the process started: xwininfo, xlsclients, xwd, the ImageMagik collection, and the aforementioned Xvfb.
--- rod.
|