fawno/gsapi

PHP wrapper class for GhostscriptAPI

0.0.3 2022-06-05 01:46 UTC

This package is auto-updated.

Last update: 2024-04-05 06:17:22 UTC


README

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