Skip to content

Ghostscript PHP wrapper for converting PDFs to images

License

Notifications You must be signed in to change notification settings

robgridley/ghostscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ghostscript PHP

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);

About

Ghostscript PHP wrapper for converting PDFs to images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages