dev-master
9999999-dev https://github.com/GravityMedia/GhostscriptGhostscript is an object oriented Ghostscript binary wrapper for PHP.
MIT
The Requires
- symfony/process ^2.8
- php >=5.6
The Development Requires
ghostscript gravitymedia
Wallogit.com
2017 © Pedro PelĂĄez
Ghostscript is an object oriented Ghostscript binary wrapper for PHP.
Ghostscript is an object oriented Ghostscript binary wrapper for PHP., (*2)
This library has the following requirements:, (*3)
Install Composer in your project:, (*4)
$ curl -s https://getcomposer.org/installer | php
Require the package via Composer:, (*5)
$ php composer.phar require gravitymedia/ghostscript:v2.4
This is a simple usage example how to convert an input PDF to an output PDF., (*6)
// Initialize autoloader
require_once __DIR__ . '/vendor/autoload.php';
// Import classes
use GravityMedia\Ghostscript\Ghostscript;
use Symfony\Component\Process\Process;
// Define input and output files
$inputFile = '/path/to/input/file.pdf';
$outputFile = '/path/to/output/file.pdf';
// Create Ghostscript object
$ghostscript = new Ghostscript([
'quiet' => false
]);
// Create and configure the device
$device = $ghostscript->createPdfDevice($outputFile);
$device->setCompatibilityLevel(1.4);
// Create process
$process = $device->createProcess($inputFile);
// Print the command line
print '$ ' . $process->getCommandLine() . PHP_EOL;
// Run process
$process->run(function ($type, $buffer) {
if ($type === Process::ERR) {
throw new \RuntimeException($buffer);
}
print $buffer;
});
Clone this repository, install Composer and all dependencies:, (*7)
$ php composer.phar install
Run the test suite:, (*8)
$ php composer.phar test
Clone this repository, install Composer and all dependencies:, (*9)
$ php composer.phar install
Generate the documentation to the build/docs directory:, (*10)
$ php composer.phar doc
Please see CONTRIBUTING for details., (*11)
The MIT License (MIT). Please see License File for more information., (*12)
Ghostscript is an object oriented Ghostscript binary wrapper for PHP.
MIT
ghostscript gravitymedia