Skip to content
This repository was archived by the owner on Feb 9, 2024. It is now read-only.
This repository was archived by the owner on Feb 9, 2024. It is now read-only.

Getting org.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -13 #62

@mananshah88

Description

@mananshah88

Hi,
I am facing a weird problem. My code works on my machine but not on production. :D :D :D

Ghostscript: 9.18 (2015-10-05)
Ghostscript4j : 1.0.1
jna: 4.1.0
( all versions are same on local machine as well as on production.)

I am trying to create thumbnail from the PDF file.

Here is my code:

Ghostscript gs = Ghostscript.getInstance();
String[] gsArgs = new String[11];
gsArgs[1] = "-sDEVICE=png16m";
gsArgs[2] = "-dPDFFitPage=true";
gsArgs[3] = "-dDEVICEWIDTHPOINTS=680";
gsArgs[4] = "-dDEVICEHEIGHTPOINTS=480";
gsArgs[5] = "-dBATCH";
gsArgs[6] = "-dNOPAUSE";
gsArgs[7] = "-dNOPROMPT";
gsArgs[8] = "-dQUIET";
gsArgs[9] = "-sOutputFile=some_file_name";
gsArgs[10] = "some_input_file_name";

try {
	gs.initialize(gsArgs);
	gs.exit();
} catch (GhostscriptException e) {
	e.printStackTrace();
}

The error I got on my production is:

org.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -13
	at org.ghost4j.Ghostscript.initialize(Ghostscript.java:365)
        .....
org.ghost4j.GhostscriptException: Cannot initialize Ghostscript interpreter. Error code is -13

Can anyone gives me any direction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions