Page 1 of 1
HTML rendering service or API
Posted: Tue Nov 04, 2008 10:58 am
by alex.barylski
I have seen these around before...either as a web service or other...
Ideally I'd like a PHP extension which accepted HTML file and rendered the result as an PNG.
Anyone know of anything?
Cheers,
Alex
Re: HTML rendering service or API
Posted: Tue Nov 04, 2008 12:41 pm
by onion2k
By far the easiest way is to use something like
http://www.shrinktheweb.com/ ... it's possible to do it with scripting (eg COM on Windows, shell on Linux) but it's incredibly fragile. How you actually achieve it really depends on your server platform.
If you're on Windows try
http://uk2.php.net/manual/en/function.i ... window.php ... maybe you'll have more luck with it than I have. I've never got it to work.
Re: HTML rendering service or API
Posted: Tue Nov 04, 2008 1:02 pm
by panic!
http://khtml2png.sourceforge.net/
requires you have a gui running on the server though.
Re: HTML rendering service or API
Posted: Tue Nov 04, 2008 1:02 pm
by panic!
or at least available.
Re: HTML rendering service or API
Posted: Tue Nov 04, 2008 6:07 pm
by alex.barylski
onion: Why weren't you able to get it to work on Windows?
If my server was a Windows machine I could probably figure it out, unfortunately my server is a Linux Debian...
I managed to dig up some additional resources:
http://www.boutell.com/webthumb/
http://khtml2png.sourceforge.net/
http://ipinfo.info/html/rendering_services.php
Hopefully one of these will suffice.

Re: HTML rendering service or API
Posted: Wed Nov 05, 2008 5:56 am
by onion2k
PCSpectra wrote:onion: Why weren't you able to get it to work on Windows?
No idea. It just returned a blank image handle. I didn't try very hard..