Ghost4J: Ghostscript brought to Java

Gilles Grousset
Hack Like a Pirate
Published in
2 min readJan 20, 2011

Ghost4J is an open source Java library I’ve been working on for sometime now: it’s a JNA wrapper on the Ghostscript C API.

I got the idea of writing this library at the end of 2008 after reading an article about the JNA library (Java Native Access) an alternative to JNI (Java Native Interface) — that allows communication of native C libraries with Java — but does not require to write and compile native C code.

When I came to testing JNA, writing a Ghostscript wrapper was the first thing that came to my head, as I spent long hours struggling on Java/Ghostscript tight integration in the past (…and that I ended up calling Ghostscript command line… Like everyone). Moreover, no body seemed to have already done this job before.

The first version was released a few week after, and was followed by others in the months to come.

Version 0.4.0 came out on last december, a major milestone, as it is now possible to run concurrent Ghostscript threads, a major drawback of the previous versions (due to the C API design) and a ‘high level’ API was added on top of the wrapper to ease common processings such as Postscript/PDF conversion, rendition, font analysis in PDF files and more…

If want to use it, you can start by reading examples here.

Originally published at https://blog.grousset.fr on January 20, 2011.

--

--