Can there be in whatever way of going for a screenshot of the website in PHP, then saving it to some file?

Sure you are able to, but you will need to render the page with something. If you want to simply use php, it is best to HTMLTOPS, wich render the page and output it inside a ps file (ghostscript), then, convert it inside a .digital, .png, .pdf.. could be little reduced with complex pages (and dont support all of the CSS).

Else, you should use wkhtmltopdf to output a html page in pdf, digital, whaterver.. Accept CSS2., make use of the webkit (safari's wrapper) to render the page.. so ought to be fine. You need to do the installation in your server, too..

EDIT: You should use the imagemagick tool for changing pdf to png. My version of wkhtmltopdf doesn't support images. E.g. convert html.pdf -append html.png.

EDIT: This small spend script provides a simple / but working usage example on linux with php5-cli and also the tools pointed out above.

EDIT: i observed since the wkhtmltopdf team is focusing on another project: wkhtmltoimage, that provides the digital directly

Since PHP 5.2.2 it's possible, to capture an internet site with PHP exclusively!

imagegrabscreen — Captures the entire screen


$img = imagegrabscreen()

imagepng($img, 'screenshot.png')


imagegrabwindow - Grabs a window or its client area utilizing a home windows handle (HWND property in COM instance)


$Browser = new COM('InternetExplorer.Application')

$Browserhandle = $Browser->HWND

$Browser->Visible = true

$Browser->Fullscreen = true

$Browser->Navigate('http://world wide')


$img = imagegrabwindow($Browserhandle, )


imagepng($img, 'screenshot.png')


Edit: Note, these characteristics can be found on Home windows systems ONLY!

This should actually be healthy for you:

Make certain you download the wkhtmltoimage distribution!

It's in Python, but groing through the documentation and code you can observe just how this is accomplished. If you're able to run python, then it is a ready-made solution for you personally:

Observe that everything can operate on one machine for just one platform, a treadmill machine with virtual machines running another platforms.

Free, free, scroll to bottom of page for links to documentation, source code, along with other information.

Yes. You'll need several things tho:

See khtmld(aemon) on *nx. See Url2Jpg for Home windows but as it is dotNet application it's also wise to chek Url2Bmp

Both of them are console tools that u can utilise out of your web application to find the screenshot.

You will find also web services that provide it. Check this out for instance.


This link is helpful to.

In a roundabout way. Software for example Selenium have features such as this and may be controlled by PHP but produce other dependencys (for example running their java-based server on the pc using the browser you need to screenshot)

I have been digging for something which are designed for this and that i discovered this straightforward PHP class that's absolutely amazing!

I discovered this short article that informs you the way to get it done (with code example). Scroll towards the bottom to take a look.

http://world wide