fawno / gsapi
GhostscriptAPI的PHP包装类
0.0.3
2022-06-05 01:46 UTC
Requires
- php: >=7.4.0
- ext-ffi: *
This package is auto-updated.
Last update: 2024-09-05 07:17:57 UTC
README
GhostscriptAPI
PHP包装类,用于Ghostscript API
要求
- PHP >= 7.4.0
- Ghostscript >= 9.18
- ext-ffi (Foreign Function Interface 扩展)
安装
php composer.phar require "fawno/gsapi"
<?php require __DIR__ . '/vendor/autoload.php'; use Fawno\GhostscriptAPI\GSAPI;
示例
require __DIR__ . '/vendor/autoload.php'; use Fawno\GhostscriptAPI\GSAPI; use Fawno\GhostscriptAPI\GSAPIException; $gs = new GSAPI('/usr/gs920/bin/gsdll64.dll'); $params = [ '-sDEVICE=pdfwrite', '-dPDFSETTINGS=/ebook', '-sOutputFile=ebook.pdf', 'original.pdf', ]; try { $gs->run_with_args($params); } catch (GSAPIException $exception) { echo $exception; }