The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

GSAPI - Perl extension for accessing GNU Ghostscript

SYNOPSIS

  use GSAPI;
  my $inst = GSAPI::new_instance();
  GSAPI::init_with_args($inst);
  GSAPI::run_string($inst, "12345679 9 mul pstack quit\n");
  GSAPI::exit($inst);
  GSAPI::delete_instance $inst;

ABSTRACT

GSAPI is an interface to GNU Ghostscript. It's mainly written to provide a simply interface to ghostscript that works under Win32 and Unix.

DESCRIPTION

($prod, $cpy, $rev, $revd) = revision()
   Returns Product name, Copyright, Revision and Revision Date
   of the ghostscript release.
$inst = new_instance()
   Returns the instance handle.
delete_instance($inst)
   Destroys the instance.
set_stdio($inst, &stdin, &stdout, &stderr)
   Sets the callbacks for ghostscript I/O
   stdin gets the maximum number of bytes to return on input and should
   return a string up to that length.
   stdout/stderr gets the string passed and they should return the number
   of bytes written.
   Example:

   set_stdio $inst,
             sub { "\n" },
             sub { print STDOUT $_[0]; length $_[0] },
             sub { print STDERR $_[0]; lenngth $_[0] };
$rc = init_with_args($inst, ...)
   initializes the ghostscript stuff.
$rc = exit($inst)
   calls gsapi_exit
$rc = run_string($inst, $string, [$user_errors ])
   calls gsapi_run_string_with_length
$rc = run_file($inst, $filename, [$user_errors])
   calls gsapi_run_file
$rc = run_string_begin($inst, [$user_errors])
   calls gs_run_string_begin
$rc = run_string_end($inst, [$user_errors])
   calls gs_run_string_end
   
$rc = run_string_continue($inst, $string, [$user_errors])
   calls gsapi_run_string_continue
  
   =item TIEHANDLE $class, [ stdin => sub { getc STDIN }, ]
                        [ stdout => &stdout, ]
                        [ stderr => stderr, ]
                        [ args => [ arg1, arg2, ...], ]
                        [ user_errors => 0|1, ]

EXPORT

None by default.

AUTHOR

Stefan Traby, <stefan@hello-penguin.com>

COPYRIGHT AND LICENSE

Copyright 2003,2005 by Stefan Traby <stefan@hello-penguin.com> Copyright (C) 2003,2005 by KW-Computer Ges.m.b.H Graz, Austria.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License 2.0 or any later version.

The main reason why this module is not available under dual license (Artistic/GPL) is simply the fact that GNU Gostscript is only available under GPL and not under Artistic License.