Duplicate:
Is it possible to take a screenshot of the current page using PHP?
Duplicate:
Is it possible to take a screenshot of the current page using PHP?
No*
PHP doesn't render the page, the browser does.
Here is a list of tools that let you do what you're after.
In theory, you could write a HTML layout engine as a PHP extension, and use that... But, no, there's nothing already in PHP that'll do what you want.
You could use a command-line utility like this and call it from PHP.
You could install webkit2png on your server and then execute webkit2png http://yourpage.example.com
from your PHP script. That will give you a screenshot the way Webkit renders the page. For installing on Linux, see this.
If you are using Windows platform, you can install ACA WebThumb ActiveX: http://www.acasystems.com/en/web-thumb-activex
A simply demo:
<?php
// PHP html to image.
// This script shows how to convert the google.com homepage to a PNG image file.
$WebThumb_Maker = new COM('ACAWebThumb.ThumbMaker')
or die("Start ACAWebThumb.ThumbMakerfailed");
$WebThumb_Maker->SetURL("http://www.google.com");
if ( 0 == $WebThumb_Maker->StartSnap() )
{
// Tanke snapshot successful, call SetImageFile() to save the image as a PNG file.
echo "Take snapshot successful." ;
$WebThumb_Maker->SaveImage("google.png");
}
?>