dev-master
9999999-devSimple, self-contained library allows you to capture screenshots using PhantomJS.
The Requires
- php >=5.4.0
- symfony/process 2.5.*
The Development Requires
by Mathias Hansen
Wallogit.com
2017 © Pedro Peláez
Simple, self-contained library allows you to capture screenshots using PhantomJS.
This simple, self-contained library allows you to capture screenshots using PhantomJS., (*2)
The library is much inspired by Laravel Cashier's PDF generation process., (*3)
You can install this package through Composer. Edit your project's composer.json file to require engage/portrayal., (*4)
"require": {
"engage/portrayal": "dev-master"
}
Now run composer update from the terminal, and you're good to go!, (*5)
$capture = new \Engage\Portrayal\Capture;
$filename = $capture->snap('https://github.com/engagedc/Portrayal', sys_get_temp_dir());
// $filename = /var/folders/6_/htvcfzcd4cb_w9z6bgpmnx5h0000gn/T/d0582362c2ffbf50ee119e504bb64fdc6bba5abd.png
You can adjust the timeout value by appending a third parameter to snap(...). E.g. 15 second timeout: $filename = $capture->snap('https://github.com/engagedc/Portrayal', sys_get_temp_dir(), 15);, (*6)
Simple, self-contained library allows you to capture screenshots using PhantomJS.