PHP code example of fawno / gsapi

1. Go to this page and download the library: Download fawno/gsapi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fawno / gsapi example snippets



  Fawno\GhostscriptAPI\GSAPI;

    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;
  }
sh
php composer.phar