engage/描绘

该包最新版本(dev-master)没有可用的许可证信息。

简单、独立的库,允许您使用 PhantomJS 捕获屏幕截图。

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

This package is not auto-updated.

Last update: 2024-09-20 20:46:48 UTC


README

Build Status

描绘

这个简单、独立的库允许您使用 PhantomJS 捕获屏幕截图。

该库深受 Laravel Cashier(https://github.com/laravel/cashier)的 PDF 生成过程启发。

安装

您可以通过 Composer 安装此包。编辑您的项目 composer.json 文件以需要 engage/portrayal

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

现在在终端中运行 composer update,然后您就可以使用了!

用法

$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

您可以通过向 snap(...) 添加第三个参数来调整超时值。例如,15秒超时:$filename = $capture->snap('https://github.com/engagedc/Portrayal', sys_get_temp_dir(), 15);