Screenshot from current page using PHP

Duplicate:

php website screenshots

Is it possible to take a screenshot from the current page using PHP?

+1
php mysql
May 07 '09 at 12:44
source share
7 answers

If you are in the windows. There imagegrabscreen ()

+1
May 7 '09 at
source share

PHP does not display the page the browser does.

Here is a list of tools that let you do what you need.

+4
May 7 '09 at 12:49
source share

No *

  • PHP runs on a web server, not on the client where the browser is located, and cannot remotely control the browser or other parts of the operating system.
+3
May 7 '09 at 12:49
source share

You can install webkit2png on your server and then run webkit2png http://yourpage.example.com from your PHP script. This will give you a screenshot of how Webkit displays the page. For installation on Linux, see This .

+2
Jul 30 '10 at 9:34
source share

In theory, you could write the HTML linking mechanism as an extension of PHP and use it ... But no, there is already nothing in PHP that will do what you want.

You can use a command line utility like this and call it from PHP.

+1
May 7 '09 at 12:52
source share

Here's a neat addition to Firefox: Screengrab!

+1
May 7 '09 at 1:46 p.m.
source share

If you use the Windows platform, you can install ACA WebThumb ActiveX: http://www.acasystems.com/en/web-thumb-activex

Just a 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"); } ?> 
+1
Aug 05 '10 at 3:29
source share



All Articles