Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
pstops filter corrupts PostScript #1470
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.
Get HP's PPD file for the HP LaserJet 4050
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:
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
Error: /undefined in stoppe
Additional information: [/Duplex false]
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:
application/postscript application/vnd.cups-postscript 66 pstops
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.
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...
--- emit.c (revision 5256)