engage/portrayal

There is no license information available for the latest version (dev-master) of this package.

Simple, self-contained library allows you to capture screenshots using PhantomJS.

dev-master 2015-02-06 21:08 UTC

This package is not auto-updated.

Last update: 2020-08-14 02:10:43 UTC


README

Build Status

Portrayal

This simple, self-contained library allows you to capture screenshots using PhantomJS.

The library is much inspired by Laravel Cashier's PDF generation process.

Installation

You can install this package through Composer. Edit your project's composer.json file to require engage/portrayal.

"require": {
	"engage/portrayal": "dev-master"
}

Now run composer update from the terminal, and you're good to go!

Usage

$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);