As a consequence the method returns false and the choosen device is pswrite instead of ps2write.
But pswrite is not a supported device.
This leads to this error:
org.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -100
There is a problem when parsing the device names to check if ps2write device is supported.
Here is the content of the result variable on line 121:
On line 127 you do:
String[] deviceNames = lines[i].substring(1, lines[i].length() - 2).split("/")
The substring seems to be too short as we get:
[, pnggray , tiffsep1 , bmpgray , ...., eps9high , ps2writ]
The e from ps2write is missing.
As a consequence the method returns false and the choosen device is pswrite instead of ps2write. But pswrite is not a supported device. This leads to this error:
org.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -100