robgridley / ghostscript
Ghostscript wrapper for converting PDFs to images
Installs: 2 483
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=7.0.0
- symfony/process: ^4.0|^5.0|^6.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^6.4|^8.0
This package is auto-updated.
Last update: 2024-11-21 14:53:29 UTC
README
Yet another Ghostscript PHP wrapper for converting PDFs (or PS files) to images. This library accepts strings, streams or real files as input and returns the output from stdout as a string.
Installation
composer require robgridley/ghostscript:dev-master
Usage Example
use RobGridley\Ghostscript\Devices; use RobGridley\Ghostscript\RealFile; use RobGridley\Ghostscript\Ghostscript; use RobGridley\Ghostscript\VirtualFile; $device = new Devices\Png24; $device->setDownScaleFactor(2); $gs = new Ghostscript($device); $gs->setPageBox('trim'); $gs->setResolution(144); $file = new RealFile('/path/to/file.pdf'); // or $file = new VirtualFile($someString); $image = $gs->convert($file);