Re: Creating Thumbnail image of a webpage ?
- From: -Lost <maventheextrawords@xxxxxxxxxx>
- Date: Thu, 07 Jun 2007 13:29:57 -0400
Rik wrote:
On Thu, 07 Jun 2007 14:21:56 +0200, Prince of Code <princeofcode@xxxxxxxxx> wrote:
How do i create a image of webpage in php? Basically what I am looking
for is "Create a small image (Thumbnail) of a webpage.
Let me know about your thought.
Your Help is greatly appreciated !
With PHP?
Very, very tricky. PHP is not a browser, so it has no clue how to handle HTML/CSS/etc., so it would have to be told this.
You could use some code of HTML2PS packages and take it from there.
Depending on how often you need this, just making a screenshot by hand is often a far more costeffective solution.
Hrmm... I do not think it would be too tricky.
Using CURL, or fopen, or whatever other method suits you to retrieve the contents.
Parse script tags and style declarations (making sure to look for @imports, et cetera).
Then you could fire open a quick instance of whatever browser or COM instance you desire, fire a snapshot utility, save that and resample with PHP's image functions, GD or ImageMagick.
This is pretty much what browsershots.org does.
The biggest difficulty that springs to my mind is this is probably not something that can be done on a shared hosting plan or whatnot. Heck, maybe not even on a dedicated server unless you are the one who runs it.
--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am kidding. No I am not.
.
- Follow-Ups:
- References:
- Creating Thumbnail image of a webpage ?
- From: Prince of Code
- Re: Creating Thumbnail image of a webpage ?
- From: Rik
- Creating Thumbnail image of a webpage ?
- Prev by Date: Re: Centering text in a dynamically created image (GD or ImageMagick).
- Next by Date: drop down populated by database
- Previous by thread: Re: Creating Thumbnail image of a webpage ?
- Next by thread: Re: Creating Thumbnail image of a webpage ?
- Index(es):
Relevant Pages
|
Loading