0

this is the code that i have copied from ghost4j official site.:

        BasicConfigurator.configure();

        Ghostscript gs = Ghostscript.getInstance();

        String[] gsArgs = new String[7];
        gsArgs[0] = "-dQUIET";
        gsArgs[1] = "-dNOPAUSE";
        gsArgs[2] = "-dBATCH";
        gsArgs[3] = "-dSAFER";
        gsArgs[4] = "-sDEVICE=display";
        gsArgs[5] = "-sDisplayHandle=0";
        gsArgs[6] = "-dDisplayFormat=16#804";

        try {

            gs.initialize(gsArgs);
            gs.runFile("input.ps");
            gs.exit();

        } catch (GhostscriptException e) {
            System.out.println("ERROR: " + e.getMessage());
        }
    }}

link to the official site: enter link description here

and this is the console output: enter image description here

KenS
  • 30,202
  • 3
  • 34
  • 51

1 Answers1

0

This isn't a PostScript nor a Ghostscript question.

If I were you I would first try running Ghostscript from the command line with the same set of parameters and see if that works.

If it doesn't then you'll have more information to try and track down the problem.

The output in your question is not standard Ghostscript output and so must be produced from Ghost4j. You should drop the -dQUIET while you are trying to debug a problem, auppressing output won't help.

In fact I'd also drop the DisplayHandle and DisplayFormat, BATCH, NOPAUSE and SAFER switches. Finally you should put a fully qualified path in for "input.ps" in case the current directory is changed.

KenS
  • 30,202
  • 3
  • 34
  • 51