fawno / gsapi
PHP wrapper class for GhostscriptAPI
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:C
Requires
- php: >=7.4.0
- ext-ffi: *
This package is auto-updated.
Last update: 2024-12-05 07:53:59 UTC
README
GhostscriptAPI
PHP wrapper class for Ghostscript API
Requirements
- PHP >= 7.4.0
- Ghostscript >= 9.18
- ext-ffi (Foreign Function Interface extension)
Instalation
php composer.phar require "fawno/gsapi"
<?php require __DIR__ . '/vendor/autoload.php'; use Fawno\GhostscriptAPI\GSAPI;
Example
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; }