homepage Welcome to WebmasterWorld Guest from 50.17.107.233
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Convert HTML to Image
to get thumbshots of website
ebizcamp




msg:431090
 8:02 pm on May 25, 2004 (gmt 0)

Hi,

Thumbshots.org provides thumbshots for DMOZ website. I think this feature is very cool.

I want to do the same thing for my link indexing site. Many websites in my directory are not in DMOZ so I cannot only use thumbshots.org's service.

I wonder if Perl can do this: Visit websites automatically and print(save) the homepage of the destination website in Image format.

I think first I need to have Perl visit those site, I know that can be realized by LWP.

Next, I wonder if I shall have perl save the homepage locally and then convert the html page into image format.

Regarding the 2nd step, I have no idea about how to achieve that. I searched Internet and did not find useful information about Convert HTML to Image in Linux.

I know there are some programs can convert HTML to PDF in linux. Can anybody give me a hint how to convert HTML to Image (GIF,PNG,JPEG) in linux?

Thanks a lot!

 

jk3210




msg:431091
 8:17 pm on May 25, 2004 (gmt 0)

Is there any way for Perl to activate the "Print Screen" function in Windows, maybe?

VectorJ




msg:431092
 2:58 am on May 27, 2004 (gmt 0)

I've been pondering this for a couple of days and the only thing I've come up with is that jk3210 is totally right. I think that you'd have to have a browser or similar software render the page, then read the memory locations of the rendered page image. "Print screen" is already set up to do that, and with a bit of cropping you'd come up with a screen shot. I don't know how to call system functions in a Windows environment, but jk3210 seems to be on the right track.

Josk




msg:431093
 12:55 pm on May 27, 2004 (gmt 0)

If you have access to a Linux box with KDE perhaps khtml2png is what you want?

ebizcamp




msg:431094
 7:13 pm on May 27, 2004 (gmt 0)

Thanks all of you for replies. The motivation I want this function is I think it's good to add snapshot of website to my site.

But I come to realize it is rather hard to do it. Like jk3210 & Josk said, to call browser (either in Windows or in Linux) and then "print" the screent can do that but that's may be slow and resource intensive.

Someone else tells me that if don't want to call browsers, then I have to write my own HTML parser to render the page, to read and then convert HTML directly into image. If that's true, then I think I'd better forget it.

Alexa.com and Thumbshots.org both provide thumbshots for millions of websites, maybe they have their own HTML parser?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved