3

Can somebody recommend the best (and preferably portable) way to render HTML documents onto a bitmap? As far as I understand my main 2 options are WebKit and Gecko, but I wasn't able to find a good starting point on how to do it. When I last tried doing this 5 years ago, I ended up using Gecko to send the document to a printer, which is not really what I need. I need rendering to a in-memory bitmap.

To clarify: server side, no Java, no .NET, batch processing, performance, not interactive, no Javascript.

MK.
  • 33,605
  • 18
  • 74
  • 111

3 Answers3

5

You can do this from the command line using webkit2png.py, which uses Python and QtWebKit (though I haven't tried it myself yet).

Justin Johnson
  • 30,978
  • 7
  • 65
  • 89
  • this is probably very similar to cutycapt which is a Qt-based C++ program using WebKit. It's sort of good, except dragging all of Qt around for this is kind of sad. – MK. Apr 13 '10 at 19:15
  • 1
    True, but at least its better than sending it to the printer ;) – Justin Johnson Apr 13 '10 at 20:12
0

You can try the ScreenGrab plug-in for Firefox.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
0

The most promising solution I found so far is this http://sites.google.com/site/torisugari/commandlineprint2 extension for Firefox which adds a command line option for printing a file to a printer, PNG, PostScript or PDF file.

MK.
  • 33,605
  • 18
  • 74
  • 111