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.

 

Link to comment
Share on other sites

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);
?>

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.