Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.69 KB

README.md

File metadata and controls

51 lines (40 loc) · 1.69 KB

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