Open Akash1684 opened 5 years ago
Please upload a pdf document example in order to be able to reproduce the problem. It could be very well related to your content, thanks.
@4F2E4A2E - I am not able to share the exact file. However, I have added the log trace for more information. I agree that issue is related to the content of the file since the same approach worked for multiple PDF files in past.
The pattern I am seeing is that PDF files generated through Acrobat Distiller 18.0 (Windows)
are causing this issue.
Note: I've found a similar issue for PS to PDF https://stackoverflow.com/questions/9905507/what-does-this-ghostscript-error-message-mean
Did you ask the Acrobat Distiller 18.0 (Windows) about this?
Error: /nocurrentpoint in --run--
Operand stack:
--dict:14/14(L)-- --dict:0/0(ro)(G)--
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1894 1 3 %oparray_pop 1893 1 3 %oparray_pop 1877 1 3 %oparray_pop --nostringval-- --nostringval-- 6 1 10 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1155/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)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.05: Unrecoverable error, exit code 1
GPL Ghostscript 9.05: ERROR: A pdfmark destination page 5 points beyond the last page 4.
The issue is that Ghostscript is reading pdfmark and then failing on incorrect pdfmark. PDF is now generated using Adobe Acrobat Standard DC 18.11.20063
rather than Acrobat Distiller 18.0 (Windows)
so the generation software was not an issue.
I am using Ghost4j 1.0.1 with Ghostscript version Ghostscript 9.05 and converting PDF to PDF using the following parameters:
However, I am getting following exception on calling
gs.initialize(gsArgs)
:I am using thread safe approach, defined in http://www.ghost4j.org/threadsafetyandmultithreading.html and synchronizing on GS instance.