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.

Low level API not able to transform PDF to PDF in multi-threading environment #63

@Akash1684

Description

@Akash1684

I am using Ghost4j 1.0.1 with Ghostscript version Ghostscript 9.05 and converting PDF to PDF using the following parameters:

final String[] gsArgs = new String[10];
        gsArgs[0] = "-pdf2pdf";
        gsArgs[1] = "-dNOPAUSE";
        gsArgs[2] = "-dBATCH";
        gsArgs[3] = "-dSAFER";
        gsArgs[4] = "-sDEVICE=pdfwrite";
        gsArgs[5] = "-sOutputFile=" + outputFileName;
        gsArgs[6] = "-c";
        gsArgs[7] = ".setpdfwrite";
        gsArgs[8] = "-f";
        gsArgs[9] = inputFileName;

However, I am getting following exception on calling gs.initialize(gsArgs):

org.ghost4j.Ghostscript: Page 3
org.ghost4j.Ghostscript: Error: /nocurrentpoint in --run--
org.ghost4j.Ghostscript: Operand stack:
org.ghost4j.Ghostscript: --dict:14/14(L)-- --dict:0/0(ro)(G)--
org.ghost4j.Ghostscript: Execution stack:
org.ghost4j.Ghostscript: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop --nostringval-- --nostringval-- 4 1 10 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval--
org.ghost4j.Ghostscript: Dictionary stack:
org.ghost4j.Ghostscript: --dict:1157/1684(ro)(G)-- --dict:1/20(G)-- --dict:83/200(L)-- --dict:83/200(L)-- --dict:109/127(ro)(G)-- --dict:291/300(ro)(G)-- --dict:24/31(L)-- --dict:6/8(L)-- --dict:28/40(L)--
org.ghost4j.Ghostscript: Current allocation mode is local
org.ghost4j.Ghostscript: Last OS error: 2
org.ghost4j.Ghostscript: GPL Ghostscript 9.05: Unrecoverable error, exit code 1

I am using thread safe approach, defined in http://www.ghost4j.org/threadsafetyandmultithreading.html and synchronizing on GS instance.

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