khtml2png results without khtml2png

Paul Hammond mail at paranoidfish.org
Tue Feb 7 19:31:22 GMT 2006


On 7 Feb 2006, at 17:28, Chisel Wright wrote:

> At $workplace we'd like to take local HTML (with assets) and  
> generate a
> thumbnail of the rendered page.
>
> We've found khtml2png, but that requires KDE to be installed, and it's
> not really something that we can sanely run on a server.
> [scary stuff with taking actual screenshots as I understand]
>
> Has anyone already been down this road and have a [perl based if
> possible] solution?
>

Things worth investigating (aside from khtml2png) include http:// 
www.hackdiary.com/archives/000055.html (several links on that page)  
and http://www.paulhammond.org/webkit2png (requires a mac and python,  
apologies for the self promotion).

There are others, but the common theme behind all of these scripts is  
that they all require access to an x/vnc/window server of some  
description - few of the browsers offer programmatic access to the  
rendered page, and none of them will run without access to a display,  
so if running a vnc/x server is not possible then you quickly run out  
of options.

If getting the graphics from a third party is acceptable, I know of  
at least one person planning to offer http based access to  
webkit2png.  There's also http://www.thumbshots.com/.

> I feel like there ought to be a way to do something along the lines of
> using some html rendering library (gecko?) to render straight to
> jpg/png, but googling hasn't come up with anything I've been able to
> see.
>

http://weblogs.mozillazine.org/roc/archives/2005/05/rendering_web_p.html

Again, only problem is getting code that uses this functionality to  
run without access to X.

I'd be really interested in any other solutions you find to this  
problem,

Paul


More information about the london.pm mailing list