Skip to content

fawno/GhostscriptAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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