How to take a screenshot of a wepage?
Rendering HTML & CSS to a single PNG or JPEG image

$url = 'http://de77.com/'; //URL to website you want to screenshot
$json = json_decode(file_get_contents('http://api.rest7.com/v1/html_to_image.php?url=' . $url . '&format=jpg')); //jpg is smaller than png
if ($json->success)
{
$img = file_get_contents($json->file);
file_put_contents('screenshot.jpg', $img);
}
else
{
echo 'An error occured';
}
Comments