Skip to main content
Skip table of contents

Why can't I compile the iText source code?

I get an error after running mvn install -P all -e to compile and install iText. I've also done mvn clean on before hand. The error says:

testFlatteningGenerateAppearances2(com.itextpdf.text.pdf.FlatteningTest): Path to GhostScript is not specified. Please use -DgsExec

Do I need to install Ghostscript?

Posted on StackOverflow on Sep 17, 2014 by user3769040

Add the parameter maven.test.skip=true or skipTests=true in the command line. The tests create plenty of PDF files (new documents) that need to be compared with reference PDF files (existing documents stored with the tests). Ghostscript is used to create images of those PDF files. These images are compared on a pixel basis to check if the new files have the same appearance of the reference files.

If you want to build iText with the tests, you need Ghostscript. If you want to build iText merely to get a jar, you can skip the tests and you don't need Ghostscript.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.