khtmld provides an interface to control khtml2png, which creates screenshots of websites and runs on headless-server systems with a virtual X server, or a VNC server. The only requirement are some KDE libraries, providing the khtml class. With khtmld you are able to activate khtml2png through php-scripts (e.g. Generating previews of your links).
If you have also something to contribute to khtmld(aemon), please do not hesitate to inform me. Simply write an email or submit your patch/source via sourceforge.net tracker.
khtmld passes commands to khtml2png, to generate your screenshot. The daemon listens on a named pipe (FIFO) to read the information for the next job. There is a simple syntax rule for adding jobs. At first you define the target url and than the target image file on your system, seperated by a BLANK (SPACE). You can add multiple jobs at once. Just add them line by line.
Notice: May be you need to append a '\n' (NEWLINE) to each job. Depending on your scripting/programming language and functions you use.)
Command spool syntax:
[TARGET_URL] [DESTINATION_IMAGE]
Example:
BASH:
$ echo "http://www.example.com /tmp/example.png" >/tmp/khtmldspool
PHP:
<?php
$data = "http://www.example.com /tmp/example.png\n";
$fp = fopen("/tmp/khtmldspool", "w");
if ($fp) {
fwrite($fp, $data, strlen($data));
fclose($fp);
}
?>
width=1280 height=1024 scaled-width=800 scaled-height=600 flash-delay=5 time=30 display=:0.0 KHTML=disable-js KHTML=disable-javaNote: display needs to be set, check your X server config.
width=800 height=600 time=30 display=:0.0 KHTML=disable-js KHTML=disable-javaNote: display needs to be set, check your X server config.
kthmld has been tested with following khtml2png versions
| 1.0.3 | successful |
|---|---|
| 2.5.0 | successful |
| 2.6.0 | successful |
| Static_2.5.0 | not testet |
Latest Version: 0.3.8
Project hosted at Sourceforge.net: http://www.sourceforge.net/projects/khtmld