0

I try to convert the postscript file from the link to a pdf which I can view in any computer. When I try to convert it I get error about the stack:

Error: /rangecheck in --getinterval--
Operand stack:
(\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000...) 9 0 714 9 (\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000...) -714 9
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- %loop_continue --nostringval--
Dictionary stack:
--dict:1145/1684(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)-- --dict:138/300(L)-- --dict:96/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 373434
GPL Ghostscript 8.64: Unrecoverable error, exit code 1 

when I try to print it, I can print only half of it. Fortunately I can view it in the built-in document viewer of Ubuntu (I can access all pages but can't print them to file).

How can I fix this specific postscript file and convert it to pdf?

7
  • Your Ghostscript is really old. Like 6 years old.
    – ilkhd
    Mar 20, 2015 at 8:35
  • What do you suggest? Even after I upgraded I got the same error. Mar 20, 2015 at 9:15
  • Did you try hundreds of different online services? They may use different software.
    – ilkhd
    Mar 20, 2015 at 9:39
  • Yes I did. They all give this specific error. Mar 20, 2015 at 9:40
  • Okay, I did some tinkering and found that pages 36 and 49(?) are broken. If you cut them out, the ghostscript will generate the output, w/o broken pages obviously.
    – ilkhd
    Mar 20, 2015 at 10:36

1 Answer 1

1

The problem is because a PS file is an executable program and can execute improper actions, which upsets the ghostscript's virtual machine. I had located, judging by the position returned by the ghostscript what are the offending pages; those are pages 234(36) and 250(52). Then I opened the .ps file in a text editor and searched for "%%Page: 234" and "%%Page: 250" and literally cut them out (all the way to the next %%Page statement) and fed the .ps file to ghostscript (no errors) . Now I have a PDF without 2 pages.These pages can be fixed by someone who is good at PostScript.

5
  • You need just a text editor (gedit?mcedit?). Open the ps file, search for %%Page: 234, select text all the way up to %%Page: 235 (not including "%%Page: 235") and delete. Save. Repeat for page 250.
    – ilkhd
    Mar 20, 2015 at 11:43
  • But how I fix the corrupted pages? (You didn't replied in the chat). Mar 21, 2015 at 4:28
  • Sorry, need to complete registration to answer the and was busy yesterday; pages can be fixed only by an expert in Postscript and I am not; all I could do is throw the broken pages away.
    – ilkhd
    Mar 21, 2015 at 15:40
  • Thanks anyway. By the way: how did you find the corrupted pages numbers? Mar 21, 2015 at 16:14
  • Very simple: "Current file position is 373434" point into the position where the error occurred. Using a hex editor, I looked at the fiile around the spot, and discovered I am in the middle of a page; cut away, check - works.
    – ilkhd
    Mar 21, 2015 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .