khtmld(aemon)

Announcments

What is khtmld

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).

Credits

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.

How it works

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.)

Examples 1.1

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);
    }
    ?>

.khtmldrc for use with khtml2png 1.x.x

width=1280
height=1024
scaled-width=800
scaled-height=600
flash-delay=5
time=30
display=:0.0

KHTML=disable-js
KHTML=disable-java
Note: display needs to be set, check your X server config.
:0.0 should be your first screen,
:1.0 could be a second X server.

.khtmldrc for use with khtml2png 2.5.x or later

width=800
height=600
time=30
display=:0.0

KHTML=disable-js
KHTML=disable-java
Note: display needs to be set, check your X server config.
:0.0 should be your first screen,
:1.0 could be a second X

khtml2png2 doesn't have parameters like scaled-with do not put them into your .khtmldrc.

Compatibility

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

Project Information

Latest Version: 0.3.8
Project hosted at Sourceforge.net: http://www.sourceforge.net/projects/khtmld

Downloads via SourceForge

Local Downloads

tag.linux.projects.khtmld