[Foomatic] cdj880 driver produces bad PCL

Till Kamppeter till.kamppeter at gmx.net
Sat Jan 31 18:50:00 PST 2004


Problems of this kind of bugs are

- cdj880 is most probably not actively maintained any more

- The distros set up the DeskJet 880 and compatible printers with HPIJS, 
so most users do not hit this bug and so the maintainers of all 
GhostScript versions do not get appropriate bug reports

- APFL/GNU GhostScript most probably does not ship with cdj880

As I have write access to ESP GhostScript I can fix the bug there. So 
please send me patches for all PCL bugs which you find in GhostScript 
and in compile-in drivers (as I have added all of them in ESP 
GhostScript) and base the patches in the CVS of ESP GhostScript.

Send your patches also to the maintainers of the appropriate drivers or 
of AFPL/GNU GhostScript, so that they get fixed there, too.

Can anyone here on the list with an appropriate printer test the fixes.

    Till


Patrick Powell wrote:
> On Fri, Jan 23, 2004 at 10:33:04AM -0800, Patrick Powell wrote:
> 
>>Perhaps it is fate or bad luck,  but the very next driver I looked
>>at, purely at random, had a problem as well.
>>
>>TestParse_PCL
>>
>>test 0x04
>>
>> # multiple command escape sequence "\x1b&l2aolE"
>>Page Size = 2 "\x1b&l2A"
>>Page Orientation = 0 "\x1b&l0O"
>>Perforation Skip = 0 "\x1b&l0L"
>>Top Margin = 0 "\x1b&l0E"
>>Unknown escape sequence "\x1b*o1M"
>>Media Type = 0 "\x1b&l0M"
>>Vertical Cursor Position Units = 76 "\x1b*p76Y"
>>Mystery PCL Command = 26 "\x1b*g26W" DATA "\x02\x04\x02\x58\x02\x58\x00\x02\x02\x58\x02\x58\x00\x04\x02\x58\x02\x58\x00\x04\x02\x58\x02\x58\x00\x04"
>>Start Raster Graphics = 1 "\x1b*r1A"
>> # Escape sequence not terminated correctly: "\x1b*b2m"
>> # multiple command escape sequence "\x1b*b2m"
>>Set Compresion Method = 2 "\x1b*b2M"
>>Raster Y Offset = 2980 "\x1b*b2980Y"
>>
>>The Mystery PCL Command appears to be device specific, and
>>is not documented in the PCL reference materials.
>>
>>However, the command "\x1b*b2m" is followed by a ESC (\x1b),
>>which is invalid PCL format.
> 
> 
> The problem is in the gdevcd8.c and gdevcdj.c files:
> 
> /* Configure the printer and start Raster mode */
> private void
> cdj850_start_raster_mode(gx_device_printer * pdev, int paper_size,
> 			 FILE * prn_stream)
> ...
>     /* From now on, all escape commands start with \033*b, so we
>      * combine them (if the printer supports this). */
>     fputs("\033*b", prn_stream);
>     /* Set compression if the mode has been defined. */
>     if (cdj850->compression)
> 	fprintf(prn_stream, "%dm", cdj850->compression);
> 
>     return;
> }				/* end configure raster-mode */
> 
> If you observe the last couple of lines, you get:
>     \033*b1m
> in the output stream.
> 
> An intensive examination of the code used to generate the
> output (as well as the gdevcdj.c code) indicates that the
> author forgot to make the terminating command an upper
> case command.  A horrible kludge is introduced in the
> cdj_terminate_page code where they have:
> 
> 
> private void
> cdj850_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
> {
>     fputs("0M", prn_stream);	/* Reset compression */
>     fputs("\033*rC\033E", prn_stream);	/* End Graphics, Reset */
>     fputs("\033&l0H", prn_stream);	/* eject page */
> }
> 
> 
> Note the "0M" entry to terminate compresssion.  However,
> there is an \033E (PCL End of JOB) in the output as well.
> this has the interesting side effect of reseting the
> page selection code.
> 
> This most likely should be replaced by:
> 
> private void
> cdj850_terminate_page(gx_device_printer * pdev, FILE * prn_stream)
> {
>     fputs("0M", prn_stream);	/* Reset compression */
>     fputs("\033*rC", prn_stream);	/* End Graphics */
>     fputs("\014", prn_stream);	/* eject page */
> }
> 
> 
> I suspect that this might be the origin of some odd problems
> with setting PCL options.
> 
> 
> Also,  the PCL command to do page eject (ESC &l0H) is used,
> rather than the 'standard' form feed (FF).
> 
> I really need a printer to test this...
> 
> Patrick Powell
> 




More information about the Printing-foomatic mailing list