[Foomatic] GhostScript driver bug - May be serious

Till Kamppeter till.kamppeter at gmx.net
Fri Jan 23 09:30:45 PST 2004


And what does go wrong on the printout due to this bug?

Would a post filter replacing "ESC & | A" by "ESC & l A" correct the 
printouts?

What do you mean with "PCL page selection"? Page size selection?

Does selecting of other page sizes than letter (as for example A4 or 
Legal) also not work?

Does the problem also occur with other PCL-3/4/5/5c/5e/6/XL drivers 
("pxlmono", "lj5gray", "hl1250", "ljet3", "laserjet", "pcl3", ... 
GIMP-Print, HPIJS, Omni)?

    Till


Patrick Powell wrote:
> I have found a couple of bugs in some GhostScript drivers that
> generate PCL and PXL.  The problem is that to exercise and demonstrate
> the bugs requires the various tools and test setups that I have put
> together here.  Here is a summary of what I found and how I found it.
> I am trying to find a way to automate the testing of other drivers.
> 
> Summary:  the GhostScript -sDEVICE=ljet4 driver produces bad PCL
>   Output.  The bad PCL sequence is:
> 	ESC & | A
> 
>   A careful examination of the surrounding PCL code indicates that
>   this is part of the setup code.  The code for 'Letter' PageSize
>   selection is:
> 
> 	ESC & l A   <-- lower case L
> 
>   Note the | and (lower case) L are easy to confuse.  I suspect
>   a typo in the driver code for page selection.
> 
>   Recommendations:  forward to GhostScript maintainers, etc.
> 
>   NOTE:  This goes a long way to explain why PCL page selection
>   is not working.
> 
>   NOTE:  In the notes below, pcl6 is the GhostPCL program.  Google
>   for GhostPCL and download it from the web site.
> 
> Input file:
>     %!PS-Adobe-3.0
>     %%Pages: (atend)
>     %%BoundingBox: 0 0 170 423
>     %%HiResBoundingBox: 0.000000 0.000000 169.400000 422.400000
>     %%Creator: vim
>     %%CreationDate: 2003/11/30 18:42:44
>     %%DocumentData: Clean7Bit
>     %%LanguageLevel: 2
>     %%EndComments
>     %%BeginProlog
>     %%EndProlog
>     %%Page: 1 3
>     %%BeginPageSetup
>     %%EndPageSetup
>     /Courier
>     findfont 200 scalefont setfont
>     72 300 moveto
>     (1) show
>     showpage
>     %%PageTrailer
>     %%Page: 2 3
>     %%BeginPageSetup
>     %%EndPageSetup
>     /Courier
>     findfont 200 scalefont setfont
>     72 300 moveto
>     (2) show
>     showpage
>     %%PageTrailer
>     %%Page: 3 3
>     %%BeginPageSetup
>     %%EndPageSetup
>     /Courier
>     findfont 200 scalefont setfont
>     72 300 moveto
>     (3) show
>     showpage
>     %%PageTrailer
>     %%Trailer
>     %%Pages: 3
>     %%EOF
> 
> 
> Render:
> 
>     /usr/local/bin/gs -q -dBATCH -dPARANOIDSAFER -sDEVICE=ljet4
>       -dNOPAUSE -sOutputFile='| cat >&3' 3>&1 1>&2  -'
> 
> GS Version:
>     AFPL Ghostscript 8.11 (2003-08-16)

[...]

> 
> Output (Base64 Encoded):
>     G0UbJmwyQRsmbDBvMGwwRRsmbC0xODB1MzZaGypyMEYbJnU2MDBEGyZsMVgbJnwyQRsqckIbKnAw

[...]

> 
> Output Parsed with:
> 
>   pcl6 -dNOPAUSE -sDEVICE=pswrite -sOutputFile=/tmp/e -ZiI threepages.gs_pcl.out
> 
> Parsed PCL output: (Truncated)
> 
> [i][file pos=0]
> [i][file pos=0]
> ESC E
>    [Printer Reset]
> ESC & l
> (ESC & l) 2 A
>    [Page Size]
> ESC & l
> (ESC & l) 0 o
>    [Page Orientation]
> (ESC & l) 0 l
>    [Perforation Skip]
> (ESC & l) 0 E
>    [Top Margin]
> ESC & l
> (ESC & l) -180 u
>    [Left Offset Registration]
> (ESC & l) 36 Z
>    [Top Offset Registration]
> ESC * r
> (ESC * r) 0 F
>    [Raster Graphics Presentation Mode]
> ESC & u
> (ESC & u) 600 D
>    [Set Unit of Measure]
> ESC & l
> (ESC & l) 1 X
>    [Number of Copies]
> ESC & |
> (ESC & |) 2 A
> ESC & | A undefined             <<<--- Problem Here
> ESC * r
> (ESC * r) B
>    [End Raster Graphics (Old)]
> ESC * p
> (ESC * p) 0 x
>    [Horizontal Cursor Position Units]
> (ESC * p) 0 Y
>    [Vertical Cursor Position Units]
> 
> 
> Patrick Powell                 Astart Technologies
> papowell at astart.com            6741 Convoy Court
> Network and System             San Diego, CA 92111
>   Consulting                   858-874-6543 FAX 858-751-2435
> LPRng - Print Spooler (http://www.lprng.com)
> 
> _______________________________________________
> Foomatic-devel mailing list
> Foomatic-devel at linuxprinting.org
> http://www.linuxprinting.org/cgi-bin/mailman/listinfo/foomatic-devel
> 
> 






More information about the Printing-foomatic mailing list