[Gs-text-api] GhostScript API

Russell Lang gsview@ghostgum.com.au
Sat, 14 Jul 2001 09:15:49 +1000


Kevin,

> We are looking to use the GhostScript API through a Visual FoxPro program
> to convert a postscript file to pdf.  We have found some documentation but
> need help setting things up and getting started.  Does any one have any
> hints/suggestions/source code related to VB or VFP that would be of some
> help.

The gs-text-api is for discussion about APIs for handling text within 
Ghostscript, mainly for drivers.  It isn't appropriate to continue 
this discussion on this mailing list.

You are probably more interested in the Ghostscript interpreter API 
described in doc/API.htm.

The first way I would implement your application is to run the 
Ghostscript executable as a separate process.  Have a look at 
ps2pdf.bat and see how it calls Ghostscript when converting 
PostScript to PDF, then do a system call from your program.
Command line parameters are described in doc/Use.htm.
Some additional variables for converting ps to pdf are in
doc/ps2pdf.htm.

If you really want to call the Ghostscript DLL directly then
doc/API.htm is the best place to start.  Someone has used the old DLL 
interface with VB, but I wouldn't recommend doing that.
The new interface in doc/API.htm should work with VB, but I am not a 
VB programmer.  There is no example code for this yet.
If someone does write example code, I would be pleased to make
it available.

I doubt you can call the Ghostscript DLL directly from VFP.


Russell Lang                   gsview@ghostgum.com.au
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/