Bad PostScript data generated -- any way to diagnose?

Alex Taylor mail.me at reply.to.address
Fri Oct 15 00:22:44 PDT 2010


I'm trying to get CUPS + foomatic-rip working in our environment, but I
have a problem with GhostScript apparently choking on the final PS file.

My problem is basically this: we have an initial PostScript file (which
is generated by our own application).  Here is an example:
  http://users.socis.ca/~ataylo00/input_ps_ok.zip  (110 KB)

This file, although it generates a couple of minor DSC warnings, renders 
without trouble in GSView, and prints just fine when sent directly to a 
PostScript printer, or when printed through GhostScript.

The problem is that running the file through CUPS results in an 
unprintable file.  Here is the output of the same file, immediately
after being processed by pstops and foomatic-rip:
  http://users.socis.ca/~ataylo00/output_ps_bad.zip  (114 KB)

Attempting to run this file through GhostScript 
  gs -sDEVICE=lp9400 -dBATCH -dNOPAUSE -sOUTPUTFILE=blah foomatic-rip.ps
yields the following:
 
GPL Ghostscript  9.00 (2010-09-14)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in --.endpage--
Operand stack:
   0   true   1   (PAGE: )
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   
--nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   
fa
lse   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--   
--nostringv
al--   2   %stopped_push   --nostringval--   1745   0   3   %oparray_pop   
--nos
tringval--   1825   1   3   %oparray_pop   --nostringval--   4   
--nostringval--
 
Dictionary stack:
   --dict:1154/1684(ro)(G)--   --dict:1/20(G)--   --dict:87/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 203561
GPL Ghostscript  9.00: Unrecoverable error, exit code 1
 
 
And, sure enough, the output file is truncated right before the last few 
bytes of the job.  Obviously, the same problem occurs if the file 
actually gets sent to the printer: the printout is always missing the 
last portion.

Using CUPS 1.4.4; the problem occurs with multiple versions of 
GhostScript and foomatic-rip, on multiple different operating systems.

Is there any way to trace this error inside GhostScript?  Something
must be wrong with the PostScript data, but I don't have enough 
knowledge of PostScript to work it out on my own.

-- 
Alex Taylor
Fukushima, Japan
http://www.socis.ca/~ataylo00

Please take off hat when replying.




More information about the cups mailing list