Jump to content

Take screen shot of the webpage for a given url


sunil_23413

Recommended Posts

I have a form which has two fields

1. Email

2. Website url

When the user submits this form an email goes to the email address filled above which contains the screen shot of the webpage whose url is filled above.

        I need an image screen shot so that I can send it in an email.

      Is there a php script which can take screen shot of the webpage for a given url?

 

      I used file_get_contents() function but it does not display the webpage properly. Some images and links are not shown.

 

is the server on windows hosting and has COM access?

 

if so:

 

<?php
$ie = new COM('InternetExplorer.Application');
$ie->fullscreen = true;
$ie->visible = true;
$ie->Navigate2($theURL);
while ($ie->Busy) {
	com_message_pump(5000);
}
$i = imagegrabscreen();
$ie->Quit();
imagepng($i);
imagedestroy($i);
?>

The links and images won't work as what's probably happening is the email client is rendering the HTML taken from the web page - it's not taking an actual screen shot. As for taking a screen shot, I can't really help you. Google's probably best way to go...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.