PHP Classes

File: examples/screenShotMobileScreen.php

Recommend this page to a friend!
  Classes of Dawood Ikhlaq   PHP Chrome PDF   examples/screenShotMobileScreen.php   Download  
File: examples/screenShotMobileScreen.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Chrome PDF
Generate PDF or images of HTML pages with Chrome
Author: By
Last change: Apply fixes from StyleCI
Date: 6 years ago
Size: 455 bytes
 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * User: dawood ikhlaq
 * Date: 7/8/2017
 * Time: 3:08 PM
 */
include '../vendor/autoload.php';

use
dawood\phpChrome\Chrome;

$chrome=new Chrome('https://facebook.com', '/usr/bin/google-chrome');
$chrome->setOutputDirectory(__DIR__);
$chrome->useMobileScreen();

//not necessary to set window size
$chrome->setWindowSize($width=768, $height=768);
print
"Image successfully generated :".$chrome->getScreenShot().PHP_EOL;