Download the PHP package aki/yii2-wbsite-screenshot without Composer
On this page you can find all versions of the php package aki/yii2-wbsite-screenshot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aki/yii2-wbsite-screenshot
More information about aki/yii2-wbsite-screenshot
Files in aki/yii2-wbsite-screenshot
Package yii2-wbsite-screenshot
Short Description wbsite-screenshot for yii2 web application
License MIT
Informations about the package yii2-wbsite-screenshot
Screen
Web site screenshot tool based on PHP and PhantomJS You can use it to take screenshots for testing or monitoring service
Install
Via Composer
or add
If on any unix system, you need to make the bin
executable chmod +x /path/to/screen/bin/phantomjs
The directory /path/to/screen/jobs
must be writeble as well.
Linux requirements
- FontConfig -
apt-get/yum install fontconfig
- FreeType -
apt-get/yum install freetype*
Usage
With this library you can make use of PhantomJs to screenshot a website.
Check our demo or read the following instructions.
Creating the object, you can either pass the url on the constructer or set it later on
You can also set the browser dimensions
you can set also DOM Element Position (top, left)
This will output all the page including the content rendered beyond the setted dimensions (e.g.: all the scrollable content), if you want just the content inside those boudaries you need to clip the result
Some webpages don't have a background color setted to the body, if you want you can set the color using this method
You can also set the User Agent
And the resulted image type
- If the format is and the background color is not set, the default value will be , if the default background color will be transparent.
And most importantly, save the result
Injection your own JS into the web page
You can also run your own JS scripts or snippets before the screenshot.
For that we have the method , here are some usage examples:
Just use this method before calling
Passing options to PhantomJS
You can set the options that will be passed to the PhantomJS binary.
Other configurations
Additionally to the basic usage, you can set so extra configurations.
You can change the where the PhantomJS binary file is.
Change the jobs location
And set an output base location
You can also clean/delete all the generated job files like this:
License
The MIT License (MIT). Please see License File for more information.