Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

render HTML (convert to bitmap)

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.

like image 345
MK. Avatar asked Dec 07 '25 15:12

MK.


1 Answers

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

like image 83
Justin Johnson Avatar answered Dec 11 '25 16:12

Justin Johnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!