/GhostscriptAPI

PHP wrapper class for GhostscriptAPI

Primary LanguageCMIT LicenseMIT

GitHub license GitHub tag (latest SemVer) Packagist Packagist Downloads GitHub issues GitHub forks GitHub stars

GhostscriptAPI

PHP wrapper class for Ghostscript API

Requirements

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