Using Ghostscript as a print filter for the Minolta Pageworks 12/20 Laser Printers

Introduction

Back in Mar '99, David A. De Graaf filed a ghostscript bug report of a "ljet4 blemish" with his new Minolta PageWorks 12 printer. L. Peter Deutsch promptly reported his tests revealed no such problem with his H-P LaserJet 6P. However, Bob Lindell reported the same problem with his PageWorks 20. These printers print an ugly vertical line(s) along the right margin. An image of the blemished page is presented here. Further investigation suggests a firmware error in Minolta's decompression algorithm. We have developed a solution using standard Postscript language attributes along with new support in the Laser Jet driver.

The PCL Logical Page

PCL provides the ability to define a logical page which can be shifted and rotated relative to the physical page boundaries. The definition of the logical page from the Brother's HL-Series manual is:

Logical page - The area of the physical page on which the cursor can be positioned in LaserJet mode. You can use PCL commands to specify the position of the logical page on the physical page. Also known as the PCL addressable area.

It is our understanding, given the Brother's documentation, that the printable area of the page is the intersected area of the logical and physical page. The printable area of the physical page is additionally reduced by the unprintable hardware dependent margin areas. To maximize the printable area, it is important to adjust the logical page to provide maximal intersection with the (margined) physical page.

There may be slight variations in printing engine page alignment between individual printers and the logical page offsets could be used to compensate for this variability as well.

The offset of the logical page is specified with two PCL commands: left long-edge offset registration and top offset registration. The offsets can range from -32,727 to +32,767 in units of decipoints (1/720 of an inch).

The Ghostscript PCL5 driver

The Ghostscript PCL5 driver (gdevdjet) defaults the left long-edge offset registration to -180, shifting the logical page 1/4 inch to the left of the physical page. I assume this value was chosen empirically to provides close to maximal printable area for the HP LaserJet family of printers. It is clear, from the discussion above, that there cannot be a default value for offsets that is optimal for all printer implementations and unit variations.

The Minolta Pageworks 12/20 Printers

The Minolta Pageworks 12/20 printers claim to emulate the PCL5e language. When Ghostscript is used as a PostScript print filter for this printer, two problems arise. First, the default left long-edge offset registration of -180 is too large and creates a larger than acceptable right margin. Second, a bug in the firmware of the Minolta printer sometimes generates thin vertically printed lines at the rightmost margins of the page, occurring outside the area of the logical and physical page intersection. By definition, this area of the page should be unprintable but a bug in these printers generates spurious output in this region.

By choosing an optimal left long-edge offset registration for the given Minolta printer model, both problems are corrected. The right margin is minimized and the spurious output is suppressed. Empirically, the correct values for the Minolta Pageworks 12 model is -107 and for the Pageworks 20 model it is -60.

Changes to Ghostscript

We added support for /MediaSource to the base interpreter as well as changes to the PCL and Laser Jet driver to support /Margins and tray selection. This patch has been submitted for code review to the ghostscript development team.

A code review by the ghostscript development team pointed out that I accidently moved the /Priority key from the /InputAttributes dictionary to the page device dictionary. This has been fixed in the patch for ghostscript-7.00 and the printer description files below (4/2001)

Patch for Aladdin Ghostscript 7.00
Redhat Linux 7.1 RPM for Aladdin Ghostscript 7.00
Redhat Linux 7.1 source RPM for Aladdin Ghostscript 7.00

Minolta PageWorks 12/20 Example Printer Description Files

The contents of minpw12/20.ps is likely to be the same across all printer spool destinations for the same printer. The contents of letter.ps would change for a given spool name to reflect the default paper and/or tray selection.

minpw20.ps (save to file)
minpw12.ps (save to file)

Issuing PJL Commands

Without the generation of at least a trailing PJL UDEL command, a printer that supports PJL may consider the print job pending even after it has completed. The net result is that the printer will not go into power save mode.

All PJL options for a PageWorks 20

Redhat Linux 7.1 Installation

Here is something that will work, but I'm not very happy with it. Eventually, there should be a way to pass down the postscript printer descriptions from the spooler into mfomatic.

First, unless you want to figure out how to rebuild the "striped pickle printer db" for the Redhat "printool", I would just modify an existing printer description. I modified the description of a Minolta PagePro 8 to work for my Minolta PageWorks 20. In the file, /usr/share/printconf/foomatic/data/Minolta-PagePro_8-ljet4.foo, make the following changes:

Patch "mfomatic" to correctly output PJL after setting "'pjl' => 1," in the foomatic printer description.

Patch for Redhat Linux 7.1 mfomatic

Finally, use the -Z options in lpr to select the media. Here is an example of using different spool destinations to set the media type:

pw20-letter:\
	:sh:\
	:ml=0:\
	:mx=0:\
	:sd=/var/spool/lpd/pw20:\
	:lp=/dev/lp0:\
	:lpd_bounce=true:\
	:append_z=media=Letter:\
	:if=/usr/share/printconf/mf_wrapper:

pw20-legal:\
	:sh:\
	:ml=0:\
	:mx=0:\
	:sd=/var/spool/lpd/pw20:\
	:lp=/dev/lp0:\
	:lpd_bounce=true:\
	:append_z=media=Legal:\
	:if=/usr/share/printconf/mf_wrapper:

Redhat Linux 6.x/7.0 Installation

Appropriate values for these offsets can be configured into the spooler configuration files. Here is an example using Redhat Linux 6.x/7.0 and a Minolta Pageworks 12/20.

/var/spool/lpd/lp/postscript.cfg:
    GSDEVICE=ljet4
    RESOLUTION=600x600
    PAPERSIZE=letter
    EXTRA_GS_OPTIONS="${SPOOLDIR}/minpw20.ps ${SPOOLDIR}/letter.ps"
letter.ps (save to file)

Here is a change to the Redhat Linux print filters to support the generation of PJL commands.

Patch for Redhat Linux 7.0 print filter
/var/spool/lpd/lp/general.cfg:
    export SEND_PJL=YES
    export EXTRA_PJL_OPTIONS='@PJL SET USERNAME = ""\r\n@PJL SET PRINTQUALITY=FINEART\r\n@PJL SET RESOLUTION=600\r\n@PJL ENTER LANGUAGE=PCL\r\n'

References

Contacts

Bob Lindell
(562) 867-4355
bob@jensar.us

David A. De Graaf
DATIX, Inc.
Hilton Head Is., SC
843-785-3136, -3156 (fax)
degraaf@rhsnet.com