Fork me on GitHub

Ghost4J binds the Ghostscript C API to bring Ghostscript power to the Java world. It also provides a high-level API to handle PDF and Postscript documents with objects.

A simple example (PS to PDF conversion)

    //load PostScript document
    PSDocument document = new PSDocument();
    document.load(new File(""));

    //create OutputStream
    fos = new FileOutputStream(new File("rendition.pdf"));

    //create converter
    PDFConverter converter = new PDFConverter();

    //set options

    converter.convert(document, fos);

Maven configuration

Ghost4J Maven artifact is available in a public repository for an easier integration in Maven projects.

If you do not wish to use Maven, binary distributions are available in the Downloads section.

		<name>Ghost4J releases</name>
		<name>Ghost4J snapshots</name>


Note: since version 1.0.0, artifacts are available from the Maven Central Repository. Private repositories are not needed anymore.

Where to go next ?

  • If you are interested into PS / PDF conversion or rendition have a look at the High level API samples.

  • If you already know Ghostscript and want to perform advanced operations on documents, have a look at the Core API samples.

  • If you plan to use Ghost4J in a highly concurrent environment (such as a web server), dont forget to read Thread safety and multi-threading.