can ImageMagick be used to take a screen shot of a website and save as a gif, jpg or pnp file on the server?
I am looking for a php or perl script that will do this.
ImageMagick screen shot of webpage
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: ImageMagick screen shot of webpage
IM can take a snapshot of a display. But not a web page.
However their is a script on the IM examples web site that was contributed.
It starts a browser in a virtual X server, gets it to show an page and takes a snap shot.
Its old, and I haven't looked at it in a long time. Probably need form fixing to get working.
http://www.imagemagick.org/Usage/script ... t_webpages
I make no guarantees, and make no warranty. I didn't even write this one, though I did test run it when it first appeared.
However their is a script on the IM examples web site that was contributed.
It starts a browser in a virtual X server, gets it to show an page and takes a snap shot.
Its old, and I haven't looked at it in a long time. Probably need form fixing to get working.
http://www.imagemagick.org/Usage/script ... t_webpages
I make no guarantees, and make no warranty. I didn't even write this one, though I did test run it when it first appeared.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: ImageMagick screen shot of webpage
thanks, but my hosting company will not let me run x-server.
Re: ImageMagick screen shot of webpage
Not Imagemagick but try:
Code: Select all
<?php
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://www.google.com");
/* Still working? */
while ($browser->Busy) {com_message_pump(4000);
}$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
imagedestroy($im);
?>
Re: ImageMagick screen shot of webpage
Bonzo wrote:Not Imagemagick but try:Code: Select all
<?php $browser = new COM("InternetExplorer.Application"); $handle = $browser->HWND; $browser->Visible = true; $browser->Navigate("http://www.google.com"); /* Still working? */ while ($browser->Busy) {com_message_pump(4000); }$im = imagegrabwindow($handle, 0); $browser->Quit(); imagepng($im, "iesnap.png"); imagedestroy($im); ?>
thanks!!!
I get this error
Fatal error: Class 'COM' not found in new.php on line 2
Re: ImageMagick screen shot of webpage
Woops looks like its windows only - only tried it in my localhost.
Re: ImageMagick screen shot of webpage
Bonzo wrote:Woops looks like its windows only - only tried it in my localhost.
find what I am looking far then
Just my luck it has to be a windows server...
thanks for your help
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: ImageMagick screen shot of webpage
If you've got the html2ps delegate installed, this might work:
convert x.htm x.jpg
convert x.htm x.jpg
snibgo's IM pages: im.snibgo.com
Re: ImageMagick screen shot of webpage
snibgo wrote:If you've got the html2ps delegate installed, this might work:
convert x.htm x.jpg
thanks I will look into it. I am not sure if my hosting Company would have this installed