akrambe / shotify
使用无头Chrome将HTML转换为PDF和网页截图,无需Nodejs/npm。
0.1
2019-07-29 05:15 UTC
Requires
- php: ~7.1
- jakubkulhan/chrome-devtools-protocol: ^1.0
Requires (Dev)
- phpunit/phpunit: ^8.2
This package is auto-updated.
Last update: 2024-09-29 06:02:37 UTC
README
无需Nodejs/npm!
文档
安装
安装此包的最佳方式是通过终端的Composer。
composer require akrambe/shotify
用法
<?php require('vendor/autoload.php'); // PDF print from url Shotify\Launcher::fromUrl('http://example.com') ->saveToPDF('example.pdf'); // Screenshot Shotify\Launcher::fromUrl('http://example.com') ->captureScreenshot('hello.png', (new Shotify\Options\ScreenshotOptions) ->setQuality(70) ->setFormat('png') ); // Get document outer HTML $html = Shotify\Launcher::fromUrl('http://example.com') ->outerHtml();
许可协议
Shotify遵循GNU通用公共许可证v3.0的条款(有关详细信息,请参阅LICENSE文件)。