-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pstops filter corrupts PostScript #1470
Comments
CUPS.org User: till.kamppeter Additional note: I did not observe the problem in rev 5205, so the regression seems to be between rev 5205 and rev 5239. |
CUPS.org User: mike According to the subversion history, there are no changes to pstops.c between r5205 and HEAD. What did change is the underlying implementation of ppdEmit*() - looking into it now... |
CUPS.org User: mike Fixed in Subversion repository. The problem was simply that ppdEmitString() wasn't adding room for the newline we add to commands that are missing a trailing newline - the attached patch fixes things up - we'll be rolling a second beta at the end of the week to address this and any other issues that come up... |
"str1470.patch": Index: emit.c--- emit.c (revision 5256)
|
Version: 1.2-current
CUPS.org User: till.kamppeter
I am on CUPS 1.2 beta 1 now (SVN rev 5256) but it happened already on rev 5239.
It seems there is a bug in the pstops filter which breaks the PostScript.
To reproduce:
Get HP's PPD file for the HP LaserJet 4050
http://www.linuxprinting.org/foomatic-db/db/source/PPD/HP/mono_laser/HP_LaserJet_4050_Series.ppd
to have a pure PostScript printer which does not need GhostScript.
Add "FileDevice Yes" to /etc/cups/cupsd.conf and restart CUPS.
Set up a print queue with the downloaded PPD file:
lpadmin -p LJ4050 -E -v file:/tmp/printout -P HP_LaserJet_4050_Series.ppd.gz -o PageSize=A4
Print a job:
lpr /usr/share/cups/data/testprint.ps
Try to display the /tmp/printout which should be PostScript:
gs -sDEVICE=x11 /tmp/printout
You will get output as follows:
[root@majax c]# gs -sDEVICE=x11 /tmp/printout
ESP Ghostscript 815.01 (2005-09-22)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Bold font from /usr/share/fonts/default/Type1/n019004l.pfb... 2591852 1022928 1677540 358286 1 done.
Using NimbusSansL-Bold font for NimbusSanL-Bold.
Error: /undefined in stoppe
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Additional information: [/Duplex false]
Operand stack:
--nostringval-- --nostringval--
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1115/1686(ro)(G)-- --dict:0/20(G)-- --dict:95/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 9588
ESP Ghostscript 815.01: Unrecoverable error, exit code 1
[root@majax c]#
There is an "Error: /undefined in stoppe"
This indicates that the PostScript is broken (My LaserJet 4050 here prints a similar error message when I print this file with "nc -w1 9100 < /tmp/printout").
If I edit the file and fix the problem, The file can be correctly displayed and printed. To try it out, find
} stoppe% x y w h ESPrc - Clip to a rectangle.
and fix is as follows
} stopped cleartomark
% x y w h ESPrc - Clip to a rectangle.
Alternatively, you can get CUPS producing a correct file directly. Edit /etc/cups/mime.convs to deactivate pstops:
Change
application/postscript application/vnd.cups-postscript 66 pstops
to
application/postscript application/vnd.cups-postscript 66 -
Then /tmp/printout can directly be displayed or printed, but without pstops most option settings are ignored.
So the problem clearly lies in the pstops filter.
The text was updated successfully, but these errors were encountered: