Page 1 of 1

How to render a HTML page to image

Posted: 2008-12-11T11:02:21-07:00
by gmanojbabu
Hi All,
Is a way to render a HTML page(i.e., pass the URL ) get the thumbnail of that page.

Right now i am using a ASP.Net application to do that job by making use of web browser class in .Net framework.
The problem i am facing is, for some URLs it's not rendering the page, so i am not able to get the image of that page and one more problem is - it takes 3 to 4 seconds to render each page and 1 or 2 seconds to save that page as image.
Over all it takes around 4 to 5 seconds to do that.

But my requirement is to get the Google result and generate the thumbnails for those result and this things should be done at a high speed.

So is there a way to make use of ImageMagick to generate the thumbnails of a web page at around 1 or less then one second.

Re: How to render a HTML page to image

Posted: 2008-12-12T16:16:06-07:00
by whoisgregg
Imagemagick does not (to my knowledge) include any sort of HTML rendering engine. Typically, you would use a specialized application to do the html/css/javascript/images render then you could use imagemagick to do further post processing like making thumbnails.

webkit2png is a mac based application that does this, khtml2png is *nix based.

Since these applications have to download all the necessary files from the URL in question, it can sometimes take upwards of 2-3 seconds even for simple pages.