dev-master
9999999-devPHP wrapper for the webkit2png binary on OS X.
MIT
The Requires
- php >=5.3.0
by Kevin Jung
webkit2png kjung webkit2png-php
Wallogit.com
2017 © Pedro Peláez
PHP wrapper for the webkit2png binary on OS X.
webkit2png-php is a PHP wrapper for the webkit2png binary available on Mac OS X. Latest webkit2png version tested with this library is v0.6. For more details on webkit2png, please refer to the webkit2png project page., (*1)
To get started, require the library in your composer.json file:, (*2)
{
"require": {
"kjung/webkit2png-php": "1.0.*@dev"
}
}
Then run composer install or composer update., (*3)
require_once 'vendor/autoload.php';
$webkit2png = new \kjung\webkit2png('http://google.com');
$webkit2png->setOptions(array(
'dir' => 'screenshots/',
'width' => 1000,
'fullsize' => true
)
);
The library default directory is set to images/ but you can always override it with the dir option as seen above., (*4)
$webkit2png->getImage();
And thats it!, (*5)
$webkit2png->getQuery();
| Option | Example |
|---|---|
| width | 1280 |
| height | 800 |
| zoom | 2.0 |
| fullsize | true |
| thumb | true |
| clipped | true |
| clipped-width | 1000 |
| clipped-height | 800 |
| scale | 3.0 |
| dir | 'images/' |
| filename | 'image' |
| md5 | true |
| datestamp | true |
| delay | 3 |
| js | '\'javascript string here\'' |
| no-image | true |
| no-js | true |
| transparent | true |
| user-agent | '\'user agent string here\'' |
Keep in mind that for js and user-agent, you must either use double quotes or escape single quotes so that the string passed is wrapped by quotes., (*6)
PHP wrapper for the webkit2png binary on OS X.
MIT
webkit2png kjung webkit2png-php