GS-PCL3(1)

NAME
pcl3 — Ghostscript device driver for printers understanding PCL 3+

SYNOPSIS

gs -sDEVICE=pcl3 [gs_option | -dBlackLevels=integer | -dCMYLevels=integer | -sColorModel=model | -sColourModel=model | -dCompressionMethod=method | -dDepletion=depletion | -dDryTime=seconds | -sDuplexCapability=capability | -dLeadingEdge=edge | -dManualFeed | -sMediaConfigurationFile=pathname | -dMediaPosition=position | -sMedium=medium | -dNoHalftoning | -dOnlyCRD | -sPageCountFile=pathname | -sPJLLanguage=language | -sPrintQuality=quality | -dRasterGraphicsQuality=quality | -dSendBlackLast | -dSendNULs | -dShingling=shingling | -sSubdevice=subdevice | -dTumble | -dUseCard=boolean ] ... [file ...]

DESCRIPTION

  Supported Printers

The ghostscript device driver pcl3 (formerly called hpdj) is a ghostscript backend for printers understanding Hewlett-Packard's Printer Command Language, level 3+ ("PCL 3+", also called "PCL 3 Plus"). The driver is intended to support in particular the following printer models:

    HP DeskJet
    HP DeskJet Plus
    HP DeskJet Portable
    HP DeskJet 310
    HP DeskJet 320
    HP DeskJet 340
    HP DeskJet 400
    HP DeskJet 500
    HP DeskJet 500C
    HP DeskJet 510
    HP DeskJet 520
    HP DeskJet 540
    HP DeskJet 550C
    HP DeskJet 560C
    HP DeskJet 600
    HP DeskJet 660C
    HP DeskJet 670C
    HP DeskJet 680C
    HP DeskJet 690C
    HP DeskJet 850C
    HP DeskJet 855C
    HP DeskJet 870C
    HP DeskJet 890C
    HP DeskJet 1120C
The PCL dialect called "PCL Level 3 enhanced" is apparently a not entirely compatible modification of PCL 3+.

The driver does not support DeskJet printers understanding only Hewlett-Packard's PPA (Printing Performance Architecture) commands. If a printer's documentation does not say anything about its printer command language and you find a statement like "... is designed for Microsoft Windows" or "DOS support through Windows only", the printer is almost certainly a PPA printer and hence is intended exclusively for systems running Microsoft Windows. There exist ways of using a PPA printer with ghostscript, but not through pcl3.

Different printer models usually implement model-specific subsets of all PCL-3+ commands or arguments to commands. You must therefore tell the driver by means of the Subdevice option for which model the generated PCL code is intended. The model-dependent difference in the generated code is not great. Apart from media specifications and colour capabilities, one can consider three groups of models which are treated with significant differences:

    Group 1
        DeskJet, DeskJet Plus, DeskJet 500

    Group 2
        DeskJet Portable, DeskJets 3xx, 400, 5xx except 500 and 540,

    Group 3
        DeskJets 540, 6xx, 8xx and 1120C.
The first two groups I call the "old Deskjets", the third group consists of "new DeskJets". If you have a PCL-3+ printer not appearing in the list above, the likelihood is still good that it will accept the files generated by pcl3. You can specify one of the supported subdevices in these cases (it is sufficient to try one each from the groups just mentioned), or use the special subdevice names unspecold or unspec which are treated like members of the second and the third group above, respectively, with all subdevice-dependent checks having been turned off.

I have received reports that previous versions of this driver worked with the following printers:

    HP DeskJet 340
    HP DeskJet 400 (tested for Gray only)
    HP DeskJet 420
    HP DeskJet 500
    HP DeskJet 500C (tested for Gray only)
    HP DeskJet 520
    HP DeskJet 540
    HP DeskJet 560C
    HP DeskJet 600
    HP DeskJet 610C
    HP DeskJet 612C
    HP DeskJet 640C
    HP DeskJet 660C/660Cse
    HP DeskJet 670C
    HP DeskJet 672C
    HP DeskJet 680C
    HP DeskJet 690C
    HP DeskJet 690C+
    HP DeskJet 693C
    HP DeskJet 694C
    HP DeskJet 832C
    HP DeskJet 850C
    HP DeskJet 855C
    HP DeskJet 870Cse/870Cxi
    HP DeskJet 880C
    HP DeskJet 890C
    HP DeskJet 895Cse/895Cxi
    HP DeskJet 932C
    HP DeskJet 970C
    HP DeskJet 1100C
    HP DeskJet 1120C
    HP OfficeJet 350
    HP OfficeJet 590
    HP OfficeJet 600
    HP OfficeJet 625
    HP OfficeJet G55
    HP OfficeJet T45
    HP 2000C/Cse/CN Professional Series Color Printer
    HP 2500CM
    Lexmark 3000 Color Jetprinter

Usually the people who sent me reports did not state to which extent the driver "works" for their printer model.

If you wish to report success or failure for a particular printer model, please read the file how-to-report.txt in the pcl3 distribution. The information collected in this manner will be made available in future releases of pcl3 and through pcl3's home page on the web.

  Colour Models

Ignoring photo cartridges, DeskJet printers can be classified in four categories:

•   The printer has only a black ink cartridge.

•   The printer can print with either a black or a cyan/magenta/yellow (CMY) cartridge.

•   The printer holds a CMY and a black cartridge simultaneously, but the two groups of inks are chemically incompatible and should not be overlayed. (Don't worry: the printer is not going to explode if they do. You merely get poorer results because the black ink will spread further than it should. This is called "ink bleeding".)

•   The printer holds a CMY and a black cartridge simultaneously and the inks can be mixed. (Newer HP DeskJets use such bleed-proof inks.)

This leads to four (process) colour models for the driver:

    Gray
        Print in black. This is the default.

    CMY Print in cyan, magenta and yellow only. In this mode, "composite black" consisting of all three inks is used to stand in for true black.

    CMY+K
        Print with all four inks, but never mix black with one of the others.

    CMYK
        Print with all four inks.
As a printer with both, a black and a CMY cartridge, can also print, e.g., with black only, the printer's "cartridge state" merely identifies one of these models as the maximal one. Depending on the category of the printer, the driver will therefore accept one or more models. The possibilities are:

    DeskJet ModelColour Models
    DeskJet, DeskJet Plus, DeskJet Portable, 500, 510, 520
    310, 320, 340, 400, 500C, 540, 600Gray, CMY
    550C, 560CGray, CMY, CMY+K
    660C, 670C, 680C, 690C, 850C, 855C, 870C, 890C, 1120C
The subdevices unspecold and unspec also permit all colour models. A printer capable only of CMY might accept CMY+K or CMYK data, remapping them to CMY, and a printer capable of CMY+K might remap CMY data to CMY+K.

The colour model CMY is not useful for CMY+K or CMYK printers, and CMY+K is uninteresting if you have a CMYK printer. The colour model Gray, however, is useful even for CMY+K and CMYK printers because it can provide access to additional printer capabilities (the resolution can frequently be higher when the printer receives only monochrome data) and because ghostscript is faster in this mode.

  Media Sizes and Orientations

Ghostscript's devices implement what PostScript calls page devices. Part of the state of a page device is the current page size, an array of two numbers specifying the width and height of the medium to be printed on. The order of the two numbers is significant, i.e., the page size not only describes the "media size" (extension irrespective of orientation) but also the orientation between page contents and sheet (portrait if width ≤ height, landscape otherwise). The page size is requested by the user or the document, and it is one of the jobs of the device to satisfy this request.

Ghostscript looks at several sources to determine the page size:

•   the default size configured for gs (usually US Letter or ISO A4 in portrait orientation),

•   the value given to the option PAPERSIZE in the invocation,

•   the size requested by the document, unless you specify -dFIXEDMEDIA.

The last applicable item in this list overrides the others, hence the current page size can change at runtime.

The pcl3 driver splits the page size into media size and page orientation and passes the media size to the printer. This works only if the printer accepts this size (accepted sizes are listed in your printer's manual). The driver knows which media sizes are supported by each printer model and will refuse to print if an unsupported one is requested. Newer PCL-3+ printers accept a custom page size command which permits printing on arbitrarily-sized media but only within certain limits which are also known to the driver. Unlike the media size the page orientation is irrelevant for deciding whether a particular page size is supported or not. The driver will adapt itself as required by the PostScript language and rotate the output if necessary. (It is one of only two ghostscript drivers capable of this.)

In setting up the PostScript default user space, pcl3 does not treat envelope sizes differently from other sizes.

The subdevice unspecold accepts all sizes supported by the HP DeskJet 560C, unspec supports all discrete sizes known to the HP DeskJets 850C/855C/870C/890C and treats in addition every other size request as a custom page size without imposing any limits. In particular for these two subdevices you should change the list of supported sizes to fit your printer's capabilities; see the CONFIGURATION section below for details.

In order for a document to be printed correctly a sheet of appropriate size must be provided and the driver must know what its orientation with respect to the printing mechanism is. The latter is usually specified by reference to the feeding direction as "short edge first" or "long edge first". Don't confuse this kind of orientation with the portrait/landscape orientation: the former ("input tray orientation") refers to the orientation of the sheet with respect to the feeding direction, the latter ("page orientation") describes the orientation of the sheet with respect to the page contents. These orientations are logically independent: people inserting paper into the printer need to know about the first, people composing documents only care about the latter.

Because pcl3 has no information about the actual dimension or orientation of the medium in the input tray, you must ensure yourself that this is appropriate. By default, the driver assumes the dimension to be that requested via the page size, but you can override this assumption with an InputAttributes definition (see the Media Sources and Destinations subsection in the CONFIGURATION section below).

There is no command in PCL-3+ to tell the printer about the sheet's input tray orientation, therefore it cannot be chosen and the manufacturer must prescribe it. I am not aware of any precise and complete statement from Hewlett-Packard about what is required in this respect, hence you should check your printer's manual whether the assumptions made by pcl3 are correct or not: the driver assumes that media are always fed short edge first except when using the subdevices hpdj, hpdjplus, hpdj400, hpdj500 or hpdj500c for printing on envelope sizes (US no. 10 or ISO DL). In these cases you should insert the medium long edge first. If you find that pcl3's default behaviour is incorrect, you can override it with the option LeadingEdge or a media configuration file (see the CONFIGURATION section below).

  Print Quality and Media Properties

With the introduction of the DeskJet 540, HP added two new PCL commands to the language: "Print Quality" and "Media Type". For older DeskJets (groups 1 and 2), similar effects can be achieved by specifying some technical aspects of the printing process in detail.

You can use the PrintQuality and Medium options to adapt the driver to the desired output quality and those properties of the medium it must know about, independent of which kind of subdevice you select. If it corresponds to a printer understanding the new commands, the option values are passed through to the printer, otherwise these specifications are mapped to the older Depletion, Shingling, and Raster Graphics Quality commands based on recommendations from HP. If you are not satisfied with the result in the latter case, use the options Depletion, Shingling and RasterGraphicsQuality to explicitly set these values.

  Diagnostic Messages

Error messages issued by this driver start with "? component:" and warnings with "?-W component:". The component can be eprn, pcl3, or pclgen, corresponding to the driver's three internal layers: the eprn device extends ghostscript without knowing PCL, pclgen is a module generating PCL without being aware of ghostscript, and pcl3 is the driver proper connecting the other two layers.

All these messages are written on the standard error stream.

OPTIONS

When specifying options for gs you should keep in mind that case is significant, that some options must be passed as strings (-s) and others as general tokens (-d), and that gs effectively ignores every option it does not recognize. Hence some care in spelling parameter names is necessary.

If you are confused by the large number of options, don't worry. Just ignore those you don't understand and concentrate on the following ones, given here in the order of their importance: -sDEVICE, -sSubdevice, -sColourModel, -r, -sPrintQuality, and -sMedium.

  Standard Options

When calling gs with the pcl3 driver you can specify any option defined for ghostscript's prn (printer) device although some have particular meanings or restrictions. This includes all device-independent options described in gs(1). You should also look into ghostscript's extended documentation (file Use.htm (link to URL Use.htm) and the section Device parameters (link to URL Language.htm#Device_parameters) in Language.htm).

-sDEVICE=pcl3
    This specification selects the pcl3 driver, but this is not the only way to select it with this option. See the description of the Subdevice option below for other possibilities.

-dDuplex[=boolean] or -dDuplex=null
    This parameter requests duplex printing and can be set to true only when the DuplexCapability value is not none. The default is null which for this driver means that the printer's default setting will be used.

    To enable duplex printing on an HP DJ 970C, you must probably in addition specify -sPJLLanguage=PCL3GUI -dOnlyCRD.

    If your printer does not support duplex printing you can achieve the same effect manually by printing the odd and even pages separately (use a command like psselect(1) for extracting these parts) and reinserting the paper in between.

-r resolution
    This option specifies the resolution in pixels per inch (ppi; some people call it dots per inch, dpi). The driver checks whether the subdevice selected accepts the given resolution unless the subdevice is unspecold or unspec. Resolutions supported by at least some of the other subdevices for some of the colour models are 75, 100, 150, 300, 600×300 and 600 ppi. The default resolution for pcl3 is 300 ppi.

    At least the highest possible value should be listed in your printer's manual, but some care is necessary in the interpretation: the value given to pcl3 must be a resolution supported by the printer's hardware for all colorants simultaneously and when operating in raster graphics mode. If you are in doubt and have access to a manufacturer-endorsed driver for your printer, use pcl3opts to find out about the resolution used by that driver. Prepare for disappointments when comparing these data with the manufacturer's advertisements.

    At least some of the series-500 DeskJets claim to permit a resolution of 600 × 300 ppi. However, although these models have a 600 dpi addressable horizontal resolution grid they do not permit neighbouring pixels to be activated (and the dots printed still have a diameter of about 1/300 in). The raster data generated by gs does not obey this restriction. In addition, it is possible that the higher resolution is anyway only supported for the printer's builtin fonts and not for general raster data.

    Concerning the DeskJet 870C, my impression is that although some HP documents and drivers use expressions like "600x300 dpi C-REt color" for this printer, the model does not really support a resolution of 600 × 300 ppi. First, it does not accept pcl3's output with this resolution, and second, if one inspects the best output of HP's Windows driver for this printer with pcl3opts, one finds that the file uses what I've called a "mixed resolution", i.e., 600 ppi for black and 300 ppi for CMY. This is not supported by pcl3.

  Pcl3-Specific Options

-dBlackLevels=levels and -dCMYLevels=levels
    These options set the number of intensity levels per pixel and colorant to use when printing with black or CMY inks, respectively, and must be consistent with the colour model. They permit access to the printer's Colour Resolution Enhancement technology (C-REt) feature. The defaults are 0 or 2, depending on the colour model chosen. Other values are only accepted for the subdevices hpdj8nnc, hpdj1120c and unspec. I strongly suggest that you apply gamma correction and modify the halftone screens whenever you use non-default values for these options (see the CONFIGURATION section below).

    The subdevice unspec accepts any non-negative number of levels except 1 up to 256. The subdevices hpdj8nnc and hpdj1120c accept the levels 0, 2, 3 and 4 with the following restrictions if any of the levels is larger than 2 (these restrictions have been determined experimentally with a DeskJet 850C and are not based on HP documentation):

    •   You can't use this feature with draft quality.

    •   You can't use a colour model of CMY.

    •   You must use a resolution of 300 ppi.

    •   You must use 4 levels for black.

    When using the subdevice unspec you should expect the printer to similarly limit the possibilities. So far I have not heard of a PCL-3+ printer supporting more than four intensity levels per colorant and I even have the impression that Hewlett-Packard is abandoning this feature in favour of higher resolutions in newer printers.

    Unfortunately, there is a problem here because ghostscript's halftoning algorithm is not prepared for the situation where a device can render different small (< 32) numbers of intensity levels for different colorants. In this situation gs will in general assume that the number of black levels available is equal to that for CMY levels. Depending on which of the numbers is smaller, there will then either be unused black levels or some will be used more than once.

    Regrettably, best results on a DeskJet 850C seem to me to be achieved with 4 black and 3 CMY levels, at least on plain paper. (4 CMY levels might be right for presentation quality on glossy paper or transparencies.) The CONFIGURATION section below presents a slightly dirty path out of this difficulty. You should also consider using -dNoHalftoning.

-sColorModel=model or -sColourModel=model
    This selects the colour model to be used by the driver: Gray, CMY, CMY+K or CMYK. The default is Gray. Which colour models are accepted depends on the printer, see Colour Models in the section DESCRIPTION above.

    A value of CMY for this option also sets BlackLevels to zero, and if CMYLevels is zero when you demand any of CMY, CMY+K or CMYK, it is set to two. For all other situations you must ensure yourself that colour model and intensity levels are consistent or pcl3 will complain. This rule implies that you can ignore the level options unless you want to use a non-default number of levels.

    The PostScript page device dictionary entry ProcessColorModel will not be correct for a colour model of CMY or CMY+K. (Ghostscript returns the native colour space in this parameter, not the process colour model.)

-dCompressionMethod=method
    PCL interpreters understand several compression methods for raster graphics data in order to speed up host-printer communication. The possible choices are:
    0Unencoded, non-compressed
    1Runlength encoding
    2T{
    Tagged Image File Format (TIFF) revision 4.0 "Packbits" encoding
    T}
    3Delta Row Compression
    9T{
    Compressed Replacement Delta Row Encoding
    T}
    The default method is 9 except for the subdevices hpdj, hpdjplus, and hpdj500 where it is 3 (these printers do not support method 9), and for the subdevices unspec and unspecold where it is 2 (this seems to be the most portable method). Requesting method 3 actually leads to a combination of methods 2 and 3. The driver may temporarily choose method 0 if a compressed data sequence would be longer than its uncompressed version.

    Compression rates can vary drastically, depending on the structure of the input. However, although the absolute values change, the relative order of efficiency between the methods is usually the order of increasing method. In short: use method 9 if it is supported.

-dDepletion=depletion
    This option is only available for old DeskJets (including unspecold) and when printing in colour. The integer depletion controls an algorithm for removing certain pixels from the image; this leads to less ink being applied to the medium. The possible values for depletion are:
    1No depletion
    225%
    350%
    425% with gamma correction
    550% with gamma correction
    The values 4 and 5 are not understood by the DeskJet 500C, but even for the other printers these values are not useful because PostScript permits finer control for gamma correction through transfer functions (see the subsection Gamma Correction in the next section). The default value is derived from Medium and PrintQuality.

-dDryTime=delay
    With the exception of the DeskJets 500 and 500C, series-500 DeskJet printers can be told to guarantee a minimum drying time of delay seconds before the next page of the same print job is dropped on a newly printed page. (This interval can be terminated by pressing the Load/Eject button.) The printer will choose default values depending on the current print quality, hence it is normally not necessary to specify this option and the feature is even considered obsolete for post-series-500 DeskJets although it is still supported by some of them.

    Permissible values for delay are null and integers in the range 0 to 1200, where null instructs pcl3 not to send a corresponding command, 0 establishes default values for the current print quality, and all other values explicitly request the duration in seconds. The default is null.

-sDuplexCapability=capability
    From the point of view of a user, there are two kinds of duplex printing identified by the two possible values for the option Tumble. Not all printers capable of duplex printing, however, provide the hardware support necessary for both, hence the driver must be told what the printer offers in order to be able to compensate for the missing functionality. The parameter capability can be any of the following:
    noneno duplex capability
    sameLeadingEdgeT{
    second pass of sheet occurs with the same leading edge
    T}
    oppositeLeadingEdgeT{
    second pass of sheet occurs with the opposite leading edge
    T}
    bothT{
    second pass of sheet can occur with either edge
    T}
    This option can only be specified for unspecold and unspec. The default value is none. The correct setting for the DeskJet 970C is -sDuplexCapability=oppositeLeadingEdge.

-dLeadingEdge=edge
    This option can be used to specify which edge of the sheet will enter the printer first. The permitted values identify this edge by reference to the inherent orientation of the page contents on the sheet when printing with default settings (except for LeadingEdge) and a page size having width ≤ height ("canonical page in portrait orientation"):
    nullNo request for media orientation
    0Short edge; top of canonical page
    1T{
    Long edge; right side of canonical page
    T}
    2T{
    Short edge; bottom of canonical page
    T}
    3T{
    Long edge; left side of canonical page
    T}
    Instead of the preceding description (which is mostly the official one for this standard PostScript device parameter) I prefer to think of LeadingEdge as prescribing the orientation of default user space with respect to the feeding direction when printing a page in portrait orientation. The sheet's orientation can be deduced from this.

    As far as I know, given a particular PCL-3+ printer and a particular media size, you cannot choose between short edge first (0 or 2) and long edge first (1 or 3): this orientation is prescribed by the manufacturer and should be documented in your printer's manual. If in doubt, use short edge first.

    The default value for edge is null. This leads either to 0 or to 3, depending on whether the subdevice normally expects media of this size to be fed short edge first or long edge first.

-dManualFeed[=boolean]
    It is possible to request a DeskJet printer to wait before each page of a document until the Load/Eject button is pressed on the printer. This is mostly intended for situations where some special medium is used or the medium has to be inserted into an input slot holding only one sheet at a time. The default setting for this option is false.

    In PCL, manual feed is established by requesting a particular media source (2), hence you should expect that setting this parameter will interfere with the input tray selection via InputAttributes (see the Media Sources and Destinations subsection in the CONFIGURATION section below).

    Note that for current ghostscript versions this setting is independent of the value of the PostScript operator manualfeed in statusdict. If you want to set manual feeding from the PostScript code you must therefore use the ManualFeed entry in the page device dictionary.

-sMediaConfigurationFile=pathname
    This option must specify an existing file containing a list of supported media sizes, sheet orientations and corresponding margin descriptions for the printer. This will take precedence over the builtin subdevice-specific lists. The format of the file is described in the CONFIGURATION section below. This option is primarily intended to be used with the subdevices unspecold and unspec.

    The default is not to use a media configuration file but the builtin lists. However, a media file path can also be specified at compile time overriding the default behaviour for unspec only. Using the MediaConfigurationFile option in addition will take precedence over the compiled-in media file path.

-dMediaPosition=position
    This option sets the standard PostScript page device parameter MediaPosition to the specified value. The integer position identifies an input tray for feeding media from and must refer to an existing entry in the InputAttributes dictionary (see the Media Sources and Destinations subsection in the CONFIGURATION section below) in order to take effect. The media selection process will use this entry in preference to others provided it matches the media request. The default is not to request a particular tray by position but to look for a best match based on other properties. However, ghostscript's default configuration defines only one entry in InputAttributes anyway.

    With current ghostscript versions you can't use this parameter to select a negative position. The driver will issue a warning if you attempt it. If the entry is actually selected, a rangecheck error from ghostscript will follow. This restriction applies only to this device parameter, not to permissible values for position numbers in InputAttributes: if you want to use a negative position, you can do so by making sure that it is the only matching entry.

-sMedium=medium
    This option selects the type of medium you wish to print on as far as the printer needs to know about it. The possible choices are:
    0plain paper
    1bond paper
    2HP Premium paper
    3glossy paper
    4transparency film
    5quick dry glossy
    6quick dry transparency
    The default is plain paper. For medium, you can specify the full strings (these are the standard values), the (in some cases) one-word strings resulting from dropping "paper", "film", and "HP", or an integer. Out-of-range numerical values generate a warning but are passed through to the printer if you are using a group-3 subdevice. If you don't, the effect is the same as specifying plain paper. The values 5 and 6 are unknown to most DeskJets; the only official exception I know of is the HP 2000C printer. Your printer's manual should tell you which kinds of medium are supported.

-dNoHalftoning[=boolean]
    Specifying true for this parameter turns off halftoning. The default is false.

    For a short introduction to halftoning, see the Halftoning subsection in the CONFIGURATION section below. To turn off halftoning means that ghostscript will paint everything at the full resolution but will have to map all shades to the nearest colours the printer can represent directly. Note that a bilevel CMY or CMYK printer is only capable of 8 useful colours per pixel. This option is therefore only sensible for documents with a small number of widely different colours.

    This parameter should be superfluous because halftoning can be controlled from PostScript. I had to introduce it because ghostscript's current halftoning implementation does not always work correctly.

-dOnlyCRD[=boolean]
    This parameter influences the PCL code generated and should only be specified for group-3 DeskJets. The default value is false and leads to the new PCL command Configure Raster Data being used only when it is necessary. Specifying true leads to Configure Raster Data being used even in those cases where older commands would be sufficient.

    There are indications that printers with a PCL dialect of "PCL Level 3 enhanced" need a value of true for this option to enable some of their functionality.

-sPageCountFile=pathname
    The pathname must specify either a non-existent file in a directory with write permission or a writable file with a single line containing a non-negative integer. In the first case, pcl3 will create the file and insert the number of pages processed, in the second case the number will be incremented by that amount. Parallel invocations of gs are permitted to use the same file. pcl3 will also make the initial page count available in its page device dictionary. Note that in present ghostscript versions the PostScript operator pagecount in statusdict always returns 4711 and is not based on the value of PageCount in the page device dictionary.

    This option is mainly intended for spooler backends calling pcl3. It can be used to keep track of the total number of pages printed and also for per-job accounting. I recommend using this option for the first purpose and to make a note of the values in the resulting files whenever you insert a new ink cartridge. This will enable you to get an indication of how much a printed page costs and why it is a good idea to use draft quality whenever possible.

    The driver can be compiled without this option present but on a UNIX system I would not expect this to be done unless gs offers the same functionality in a driver-independent manner which it currently does not.

    pcl3 is distributed with an example if-pcl3 of a BSD spooler backend using this option.

-sPJLLanguage=language
    If a printer supports several command languages and PCL-3+ is not the default, the printer must be told to switch to PCL-3+ at the beginning of the print job. Hewlett-Packard's printers use a Printer Job Language (PJL) command for this purpose. Specifying this option will switch the printer to language for the duration of the job and back to the default at the end.

    This option is not usually necessary except that there are indications that printers with a PCL dialect of "PCL Level 3 enhanced" need a value of PCL3GUI for this option to enable some of their functionality. You should never use the option unless you have a reliable source for the value of language, for example the output from pcl3opts. Values I have seen so far are PCLSLEEK and PCL3GUI.

-sPrintQuality=quality
    There are three print quality settings:
    -1draft or econo
    0normal
    1presentation or best
    The default is normal. You may specify the strings or an integer. Out-of-range numerical values will generate a warning but are passed through to the printer if it is a model understanding the PCL command "Print Quality". If it isn't, the effect is the same as specifying normal.

-dRasterGraphicsQuality=quality
    This option is only available for old DeskJets (including unspecold) and controls a trade-off between quality and print speed. The possible values for quality are:
    0Use current control panel setting
    1Draft
    2High
    Specifying this option overrides the default value derived from Medium and PrintQuality.

-dSendBlackLast[=boolean]
    When printing with four inks, a PCL-3+ printer expects the colour information for a row of pixels in the order black, cyan, magenta, and finally yellow (KCMY).

    There exists at least one printer (Olivetti JP 792) which claims to accept PCL-3+ but expects the colour planes to arrive not in the order KCMY but in the order CMYK, a clear violation of PCL. If you have a printer with this property, use this option. The default value is false.

-dSendNULs[=boolean]
    Most HP drivers for newer DeskJet printers generate PCL files starting with a sequence of 600 NUL characters. I have seen no documentation of this feature, but I assume that in PCL the NUL character is a null operation. Just in case the behaviour is useful under certain circumstances, this option can be used to request it. The default is false. Note that use of this option might confuse "magical" spooler backends which try to determine the file type from the first few bytes of the file contents.

    Should you find a situation where a printer behaves differently with and without this option, send me a message.

-dShingling=shingling
    This option is only available for group-2 DeskJets (including unspecold) and controls the number of passes the print head makes over the medium. A higher number permits more neighbouring pixels to be printed in separate passes, thereby reducing the likelihood of the ink spreading into the next pixel. The possible values for shingling are:
    0No shingling
    12 passes (50% each pass)
    24 passes (25% each pass)
    Specifying this option overrides the default value derived from Medium and PrintQuality.

-sSubdevice=subdevice
    This option identifies the printer model for which the generated file is intended. The following names are accepted for subdevice:

        hpdj, hpdjplus, hpdjportable, hpdj310, hpdj320, hpdj340, hpdj400, hpdj500, hpdj500c, hpdj510, hpdj520, hpdj540, hpdj550c, hpdj560c, unspecold, hpdj600, hpdj660c, hpdj670c, hpdj680c, hpdj690c, hpdj850c, hpdj855c, hpdj870c, hpdj890c, hpdj1120c, unspec.

    The correspondence with the real printer name is, I hope, obvious. Note that hpdj does not select the hpdj driver (this driver's predecessor) but configures the pcl3 driver for the "classical" HP DeskJet.

    With the exception of hpdj, unspec and unspecold, the subdevice names might also be available as device names, i.e., instead of specifying -sDEVICE=pcl3 -sSubdevice=subdevice you might be able to write -sDEVICE=subdevice. Check ghostscript's list of available devices to find out whether this is the case (gs -h).

    The choice of subdevice primarily determines which resolutions, colour models, intensity levels and media sizes the driver will accept, where the output will appear on the page, and to some extent what PCL code the driver will generate. Some of the subdevices are treated identically.

    The default subdevice is unspec. It is intended for new PCL-3+ printers not explicitly supported by this driver. For unspec, all subdevice-specific checks (e.g., supported resolutions) are turned off. Supported media sizes and margin settings are assumed to be identical with those for the DeskJets 850C/855C/870C/890C, but you can and should use the MediaConfigurationFile option or its compile-time equivalent to override this. The PCL code generated assumes a new DeskJet in the sense that it should be at least of the level of a DeskJet 540 supporting the PCL commands Media Type and Print Quality. If you specify unequal horizontal and vertical resolutions or more than two levels of intensity per colour and pixel, the printer must in addition understand the Configure Raster Data command.

    The subdevice unspecold is similar but behaves like a DeskJet 560C. It supports all colour models and all uniform resolutions (the horizontal resolution is equal to the vertical resolution).

    If you choose to use unspec or unspecold it is your responsibility to ensure that pcl3 is only called with parameter values the printer can handle. This applies in particular to the resolution and the intensity levels.

-dTumble[=boolean]
    When duplex printing is requested (-dDuplex), this parameter specifies whether the y axes of PostScript's default user space on the two sides of the sheet (assumed to use the same page size) point to the same edge or to opposite edges. The default value false indicates the same edge and is suitable for binding on the left while true indicates opposite edges and should be used for binding at the top.

    You should note that the interpretation of Tumble refers to default user space: if a PostScript program has rotated the user space coordinate system the association between the page's apparent "up" direction and the binding edge will usually not be the one desired. You should watch for this in particular when creating output in landscape orientation from an application still generating PostScript Level 1 code. If the orientation between the two sides turns out to be wrong, you will have to print again with the opposite value for Tumble.

-dUseCard[=value]
    This option should only be given when printing on A6 and with a printer like the HP DeskJet 1120C which distinguishes between A6 sheets and A6 postcards. The option can be used to specifically request one of the alternatives. The default value is null and means that sheets are preferred to postcards, but either is acceptable if supported. The other permitted values are true and false.

    This option applies to all page sizes set while ghostscript executes and this includes the default size set at startup. If you wish to use -dUseCard=true you will therefore usually have to specify the PAPERSIZE option in the call, otherwise an error will occur because there is no postcard variant for the usual default sizes (ISO A4 and US Letter).

  Option Combinations for Different Quality Settings

Not all combinations of resolution, number of intensity levels, print quality and media type are accepted or make sense. Unfortunately, Hewlett-Packard does not publicly release sufficient information to find the best possible combinations. A good way to find reasonable settings is to use pcl3opts on files generated by an official driver for the printer. In addition, I'll provide some remarks here.

As a general rule, it is unprofitable to use a finer resolution than 300 ppi or more than 2 intensity levels for draft quality. A coarser resolution in particular can reduce the time needed to generate and transmit the file to the printer. Combined with draft quality this leads to what HP calls an "EconoFast" mode.

As an exception, here are recommendations based on official HP documentation for the DeskJet 1120C. The table lists the resolution and the number of black or black and CMY levels if not 2.

    QualityGrayCMYK
    draft300 ppi300 ppi
    normal300 ppi, 4 levels300 ppi, (4,3) levels
    presentation600 ppi300 ppi, (4,4) levels
To me, these seem reasonable values for the supported series-800 DeskJets as well except that on a DeskJet 850C I could not see significant differences between (4,3) and (4,4).

I have been told that the DeskJet 970C supports 600 ppi in colour only for presentation quality.

  Checking Page Device Parameters

As for all ghostscript devices, pcl3's command line options correspond to identically-named PostScript page device parameters and are accessible in the usual way. In particular, it is possible to read the value of a parameter by letting gs execute a command like

    currentpagedevice /parameter get ==

where parameter is the name of the parameter one would like to inspect, for example BlackLevels. This is useful if you are in doubt whether the driver has accepted your options. Of course, for some parameters you can also use pcl3opts on the output file.

The ghostscript distribution contains a program uninfo.ps which displays the page device dictionary on standard output but does not resolve nested dictionaries. The pcl3 distribution contains a similar program dumppdd.ps which does not have this limitation.

CONFIGURATION

  Media Configuration File

A media configuration file (media file for short) can be used to override the builtin subdevice-specific lists of supported media sizes and, for each size, the sheet orientation in the input tray and the margins enforced by the printer. This feature is mainly intended to be used in conjunction with unspec and unspecold: if you have a model not directly supported by this driver, look up the supported media sizes, the rules for inserting media and the corresponding printable regions in your printer's manual and enter them in a media file.

    Caution:

    Entering a media size in the file which is not really supported by your printer is not useful: the PCL interpreter will simply ignore the request to set this size, and printer and driver may have diverging opinions about what the margins will be. If you need to print on a medium of a size not supported by your printer, choose a larger and printer-supported size in PostScript or via FIXEDMEDIA, shift the image if necessary, establish properly-positioned clipping regions within the real size, and print. However, if you have a newer DeskJet supporting custom page sizes, this is not necessary.

Margin specifications are important for two reasons: the values for the left and top margins determine how the output is positioned on the page, and sufficiently large values for the right and bottom margins prevent the print head being caught at the paper's edge and printing beyond the sheet, respectively. Because DeskJet printers often have an inconveniently large bottom margin (usually 0.4-0.8 inches or 10-20 mm), one might be tempted to specify smaller values than listed in the printer's manual. However, one user reported that this led to the printer depositing a large wet blob of black ink at the bottom of the page.

A line in the media file can be blank, a comment line (first non-blank character is '#'), or one of the following:

    unitunit
    sizeleft bottom right top

A unit line specifies in which units margin specifications in the following lines should be interpreted. unit can either be in (inch) or mm (millimetre) with in being the default. A unit specification remains in force until overridden by a following unit line.

The second kind of line states that the model supports a particular media configuration and specifies the hardware margins in force for that case. The size word must start with one of the following keywords (entries marked with an asterisk are those used by the subdevice unspec if no media file is employed; entries with a section/paragraph sign (§) similarly identify the sizes used by unspecold):
Index3x5inUS index card 3 × 5 in
EnvChou4T{
Japanese long envelope #4 (90 × 205 mm)
T}
EnvMonarchT{
US Monarch envelope (3.875 × 7.5 in)
T}
*PostcardJapanese Hagaki card (100 × 148 mm)
*Index4x6inUS index card 4 × 6 in
§*Env10US no. 10 envelope (4.125 × 9.5 in)
A6ISO/JIS A6 (105 × 148 mm)
*A6CardISO/JIS A6 postcard (105 × 148 mm)
§*EnvDLISO DL envelope (110 × 220 mm)
EnvUS_A2US A2 envelope (4.375 × 5.75 in)
*EnvC6ISO C6 envelope (114 × 162 mm)
EnvChou3T{
Japanese long envelope #3 (120 × 235 mm)
T}
*Index5x8inUS index card 5 × 8 in
StatementUS Statement (5.5 × 8.5 in)
DoublePostcarddouble Postcard (148 × 200 mm)
*A5ISO/JIS A5 (148 × 210 mm)
EnvC5ISO C5 envelope (162 × 229 mm)
*JISB5T{
JIS B5 (182 × 257 mm).
This is distinct from ISO B5 (176 × 250 mm).
T}
§*ExecutiveUS Executive (7.25 × 10.5 in)
§*A4ISO/JIS A4 (210 × 297 mm)
§*LetterUS Letter (8.5 × 11 in)
§*LegalUS Legal (8.5 × 14 in)
EnvKaku2T{
Japanese Kaku envelope (240 × 332 mm)
T}
JISB4T{
JIS B4 (257 × 364 mm).
This is distinct from ISO B4 (250 × 353 mm).
T}
TabloidT{
US Tabloid (11 × 17 in; in landscape orientation also called "Ledger")
T}
A3ISO/JIS A3 (297 × 420 mm)
HPSuperBwhat HP calls Super B (13 × 19 in)
*CustomPageSizecustom page size
Note the difference between A6 (sheet) and A6Card (postcard). I do not know why Hewlett-Packard associates this distinction with media size instead of media type. However, with the exception of the 1120C all DeskJet printers I know of use only A6Card anyway. If you are in doubt what your printer understands, pcl3opts can tell you which media size another driver requests.

Custom page sizes are not understood by older printers and may be used in a media file only for the subdevices hpdj540, hpdj6nn[c], hpdj8nnc, hpdj1120c, and unspec (group 3). In these cases you can print, within certain limits, on arbitrarily-sized media. The driver knows these limits and refuses to generate a file if you exceed them. For unspec, there are no limits. pcl3 will tell the printer to expect a custom page size only if there is no fitting discrete entry.

Although it is possible, on those printers which support it, to use a media configuration file containing only a custom page size entry, I advise against it because this size specification is only intended as a last resort. If you have a custom page size entry in the media file, you should therefore list all discrete sizes supported by your printer or at least those which you expect to use.

The size keyword in the size field can be extended by the following strings:

Big For pcl3, this suffix means banner printing. In these cases the top and bottom margins are usually zero. HP DeskJets supporting banner printing do so only for ISO A4 and US Letter. Your media file should then contain entries for the sizes A4, A4Big, Letter, and LetterBig.

.Transverse
    By default, pcl3 assumes that the media listed are fed short edge first. If you specify this qualifier, the driver will assume that you are going to feed media of this size long edge first. If, for example, your printer's manual states that envelopes of size ISO DL should be fed long edge first, the corresponding size field in your media file should contain the string EnvDL.Transverse, not EnvDL.

    This specification (or its absence) can be overridden with the option LeadingEdge in the call.

The builtin lists for the unspec and unspecold devices do not contain size entries with any of these suffixes.

Every media file must contain at least an entry which fits ghostscript's default page size, usually ISO A4 or US Letter. Only those sizes which are listed will be accepted by pcl3. This is independent of a .Transverse suffix but not independent of Big. If there are several entries in the media file with the same size value, only the first is used.

The margins in a size entry should be valid for monochrome printing in raster graphics mode. If a non-monochrome colour model is selected, the bottom margins will be increased by a subdevice-specific amount. This increment is zero for unspecold and unspec.

The orientation of the margins refers to the feeding direction: you should imagine holding the sheet such that the leading edge is at the top and the side to be printed on is towards you. Be careful with envelopes: older (pre-1997) HP documentation usually gives the margins in landscape orientation even for those printers where the envelope has to be fed short edge first. You can check this by looking for the largest margin value: if it is on the left instead of at the bottom you almost certainly have such a landscape-based specification; rotate the values by +90 degrees (quarter-circle counterclockwise) in these cases. The margins have to be specified as floating point numbers in inches or millimetres as announced by the last preceding unit line. The floating point format is that of the "C" locale.

pcl3 is distributed with an example of a media configuration file, example.mcf.

  PostScript Configuration Files

Sometimes it is desirable to execute additional PostScript commands for a particular file or possibly all files sent to a particular printer or print queue. With ghostscript this is easily possible because gs accepts several file names in the invocation and processes them sequentially. This is particularly appropriate for those PostScript operators which affect device-specific features and should therefore not appear in a portable page description.

The pcl3 distribution contains an example of an input filter if-pcl3 for the BSD spooler lpr(1). This filter permits the use of a print-queue-specific configuration file.

  Media Sources and Destinations

PostScript has a builtin mechanism for selecting media sources and destinations based on certain properties of the document. This usually requires a system administrator to set the InputAttributes and OutputAttributes dictionaries in the device's page device dictionary according to the current state of the printer and its intended use. For example, if there are two input trays, one currently holding paper and the other transparencies, the administrator could configure the InputAttributes dictionary such that print jobs requesting transparencies in a certain manner automatically fetch media from the second tray and every job needing a size not currently available will terminate with an error message. Unfortunately, in order to work as expected this process usually also requires some additional action on the part of the entity generating the PostScript code to be printed.

If your printer is capable of sensing certain properties of media in the input tray (e.g., media size) or assumes a fixed association between media properties and input trays you must expect this functionality to interfere with the process referenced here.

In the attributes dictionaries, each tray is identified by an integer, its position number. When ghostscript successfully matches the document's requirements with trays the resulting position numbers are accessible to the driver. The pcl3 driver uses these numbers (except 0) directly as arguments for the PCL commands "Media Source" and "Media Destination", respectively. For the Media Source values (input trays), I know of the following meanings:

    -1banner printing
    1default tray; portable CSF (DJ 340)
    2manual feed
    3envelope feed
    4desktop CSF (DJ 340)
You'll have to experiment with your printer to find out which values are accepted and what their interpretation is. In general, you can only expect 1 and 2 to work. Unrecognized values should be simply ignored by the printer leading to the medium being fetched from the default tray. To shorten the search, use pcl3opts if you can in order to find out which values other drivers generate. Don't bother testing the value 0: in PCL its effect is to eject a page and, as this is not needed, pcl3 uses it to mean that no particular tray should be selected.

I do not know of any PCL-3+ printer supporting more than one output tray, hence the corresponding implementation is based on the speculation that such a feature, if made available, would use the same command as in PCL-5. Again, a value of zero is used by pcl3 to mean "don't select a particular tray".

Ghostscript's default configuration defines InputAttributes and OutputAttributes dictionaries with one entry each, having position number 0 in both cases, and maps all requests to these positions. As explained above, this configuration will lead to pcl3 not requesting any particular input or output tray. If you wish to modify this you should consult a PostScript manual, for example the sections 6.2.1 and 6.2.4 in the PostScript Language Reference. However, I'll present here three examples without explanation. In all cases, the PostScript code shown should be executed before the document to be printed.

The first example is intended for situations where you always wish to select a specific input tray:

    <<
      /InputAttributes <<
        0 null
        input << /PageSize [6 6 524287 524287] >>
      >>
    >> setpagedevice

Replace input with the number of the tray you wish to use. The second example does the same for the output tray:

    <<
      /OutputAttributes <<
        0 null
        output << >>
      >>
    >> setpagedevice

Replace output with the number of the tray you wish to use.

For the final example assume that you have one input tray, filled with media of a certain default size, and you wish all print jobs requesting another size to automatically switch to manual feed so you can insert these special sheets at leisure. In that case, let gs execute the following PostScript code:

    <<
      /InputAttributes <<
        0 << /PageSize [width height] >>
        2 << /PageSize [6 6 524287 524287] >>
        /Priority [0 2]
      >>
    >> setpagedevice

For width and height you must insert the actual dimensions of your default size in units of 1 bp ("big point", 1/72 inch, roughly 0.35 mm); the tolerance is 5 bp. In contrast to a document's page size, the orientation is irrelevant here.

If you drop the second entry and the Priority line in the last example you obtain a configuration where ghostscript will refuse to print any document not requesting the specified media size.

  Banner Printing

Some printers support printing on continuous forms, also called banners or z-fold media. Your printer's manual should tell you whether this is supported and in particular how to load these media.

In order to print on continuous media with pcl3, configure it as follows:

•   Define InputAttributes to have only one non-null entry, for position -1. For details, see the subsection Media Sources And Destinations above.

•   In the call to gs, select a subdevice supporting the intended "Big" size. By default, only the subdevices hpdj680c, hpdj690c and hpdj1120c support banner printing (A4Big and LetterBig).

Don't forget to prepare the printer as well.

  Correcting Offsets

A media configuration file is intended to adapt pcl3 to the difference in margin settings between printer models and should usually contain "official" information, preferably taken from the model's manual.

A different situation arises if a particular printer's output is not properly positioned on the page even if the margin information is correct for this model. PostScript defines two arrays in the page device dictionary for correcting such misadjustments, both containing two numbers describing a desired shift of the page image with respect to device space coordinate axes but in different units. The values in the `Margins' array are interpreted with respect to a canonical default resolution, the newer `PageOffset' array is taken to be in units of 1/72 inch ("big points", bp). For pcl3 the device coordinate system has an x axis pointing to the right and a y axis pointing downwards when looking at the sheet with the leading edge at the top and the side to be printed on towards you. The canonical default resolution is 300 ppi.

As an example, assume your printer shifts its output 1 mm to the right and 0.5 mm upwards. Now create a file containing either the PostScript code

    << /Margins [-11.8 5.9] >> setpagedevice

("shift 11.8 pixels to the left and 5.9 pixels down") or

    << /PageOffset [-2.8 1.4] >> setpagedevice

("shift 2.8 bp to the left and 1.4 bp down") and have it executed by ghostscript before the file to be printed. If you specify both, Margins and PageOffset, the total shift performed by gs will be the sum of the two.

The margin test files distributed with pcl3 can be used to determine the necessary correction. You should be aware that you have to expect fluctuations between individual print jobs, in particular in the horizontal direction.

  Gamma Correction

DeskJets usually produce colour prints which are too dark (too much ink on the page). In this case you should perform gamma correction by modifying what PostScript calls transfer functions. In the simplest case, create a file containing the PostScript command

    {number exp} settransfer

where a good value for number is usually in the range 0.3-0.5, and specify this file in ghostscript's command line before the file you wish to print. Now the intensities of all colorants will be rescaled by exponentiation with number. Because PostScript intensity values are in the range zero to one with zero meaning dark and one meaning light (additive interpretation), a value of number < 1 will lead to lighter colours and number > 1 results in darker colours.

You can also set independent transfer functions for the four colorants by using the operator setcolortransfer which expects four routines as arguments. Consult a PostScript manual if you want to learn more about transfer functions.

For a device with less than 32 intensity levels per colorant, at resolutions below 800 ppi, and unless you use -dNoHalftoning or explicitly set transfer functions, gs applies a default gamma correction roughly corresponding to a value of 0.8 for number.

  Different Numbers of Black and CMY Intensities

DeskJets supporting C-REt apparently achieve more than two intensities per colorant by putting a variable number of layers of the same ink on top of each other. This happens during several passes of the print head. The number of levels which can be achieved is therefore determined by the number of passes which in turn is influenced by the print quality and the media type (that is apparently the reason why using C-REt in draft quality is useless). It is now likely that if one uses more levels than can be supported by the number of passes, the higher levels will look the same. This is what seems to happen if one prints with 4 intensity levels for CMY on plain paper with a DeskJet 850C: the fourth level is accepted by the printer but to me it looks indistinguishable from the third.

In this situation we can compensate for ghostscript not correctly dealing with different numbers of black and CMY intensity levels by using PostScript's transfer functions. The idea is to specify in the invocation the higher number of levels for both, black and CMY, but to map the range for those components where actually only a smaller number of levels is distinguishable to a reduced range which gs will divide into the required (smaller) number of intervals. Although the printer will be told to expect the higher number of intensities, it will never receive them. However, if the assumptions above are correct, the highest level it does receive will anyway look like the highest level possible!

For the case of 4 black and 3 intended CMY levels the CMY intensities must be remapped from the range [0, 1] to the range [1/3, 1]. Here's the code, including an equal gamma value number for all four components:

    {number exp 2 mul 1 add 3 div}
    dup dup
    {number exp}
    setcolortransfer

In the call to gs you must now specify a value of 4 for both, BlackLevels and CMYLevels.

  Halftoning

Most printers offer only a small number of discrete intensities per colorant and pixel. In order to generate a larger range of colours, one therefore employs halftoning which consists of dividing the pixel array into halftone cells, each of which represents one effective pixel which can now display more shades. This method trades resolution for the number of shades and applies to all structures which have to be painted with a colour which cannot be represented exactly. At 300 ppi and with a bi-level device a typical choice is to use halftone cells of 5×5 pixels leading to an effective resolution of 60 ppi and 26 shades per component. These are also ghostscript's default values at 300 ppi.

Which kind of halftoning is appropriate depends not only on the printer but also on the document to be printed: a photograph will usually require more shades and hence larger halftone cells than a technical drawing where colour is merely used for emphasis. For this reason PostScript offers access to the halftoning parameters. You should use this feature in particular if your printer supports more than two intensity levels because ghostscript does not recognize by itself that it can now obtain a higher effective resolution without a loss in the number of shades. However, if you request 32 or more intensity levels from pcl3 (I don't know of any PCL-3+ printer capable of this) you need not bother about this point because in that case ghostscript will not use halftoning.

Unfortunately, ghostscript's halftoning implementation seems to have some problems. In particular, most of the ways of increasing the halftone screen frequency in PostScript apparently do not work with current ghostscript versions. I have been successful only with the somewhat pedestrian approach of using threshold arrays, and even that worked only for some cases. Therefore I have introduced the option -dNoHalftoning which can at least be used to switch off ghostscript's halftoning completely. This corresponds to halftone cells consisting of 1 pixel only.

Whenever you modify the halftone screens you should use a test file like levels-test.ps in the pcl3 distribution to check whether the desired result is achieved. In particular, you should count the number of shades you can distinguish: if it is obviously not one plus the number of pixels in the halftone screen times one less than the number of hardware intensity levels, something has gone wrong. This is, for example, the case if you specified 4 black levels and a 2×2 halftone screen, and you then can distinguish more than 1 + 4×3 = 13 intensity levels. You should also watch for non-monotonic jumps in intensity and incompletely filled shapes.

For ghostscript versions up to and including 5.50, if you are using the colour mode CMYK and more than 2 black levels you should not set merely a single halftone screen (setscreen, a type-1 or a type-3 halftone dictionary) because ghostscript's dithering routine can in this case return non-monotonic levels of black for monotonic input intensities. However, if you specify independent halftone information for the colour components, gs uses a slower but more accurate algorithm instead which does not lead to the wrong behaviour. It is not necessary for the halftone information to be different for different components to achieve this. Note that ghostscript installs separate halftone screens for CMYK devices by default if the resolution is at least 150 ppi.

LIMITATIONS

  Ghostscript Version

This manual page contains statements relying on undocumented properties of ghostscript. These statements are to my best knowledge and belief correct for at least ghostscript 6.01, and I hope I've not missed significant deviations when testing with older versions. But I can't of course guarantee anything for newer ones.

  The Rendering Algorithm

In ghostscript's internal architecture the ghostscript kernel calls on a device driver for basic drawing operations and to ship out completed pages. For most if not all print devices this process can be separated into rendering (in particular halftoning and scan conversion) in memory and transferring the resulting array of pixels to a file or directly to a printer.

Ghostscript has an abstract printer device (prn) which uses a "memory" or "command list" device for rendering and transfers the completed page to a printer-specific backend for output. Such a backend must supply several parameters for the rendering process but its main purpose is the conversion from ghostscript's internal pixel data structure to a printer-specific format. pcl3 is such a prn-derived backend. This means in particular that pcl3 does not have much influence on the rendering but also that a user can influence the rendering process by the usual methods available in PostScript.

Unfortunately, this leaves a lot to be desired. For example, there is no possibility in this implementation to request Floyd-Steinberg error diffusion. Of course, one can implement error diffusion in a ghostscript device driver and a number of people have done so in printer-specific backends. I do not believe, though, that such an implementation belongs there: it should better be implemented in an improved rendering device. In that way, it could be used for other printer-specific backends as well. This is also true for every other kind of modification of the rendering process. I had therefore deliberately restricted hpdj to be a "purely printing" backend: it knew about PCL but not about rendering. In restructuring the driver for pcl3 I have now introduced a new base device, eprn, which is independent of PCL and which could be used for such implementations. However, at present they aren't there.

Therefore, if you need better visual quality for documents with shades of grey or non-primary (non-CMYK) colours, this cannot be achieved by giving some tricky combination of option values to pcl3. Instead you should experiment with the relevant PostScript operators (see chapter 7 of the PostScript Language Reference), or ultimately extend ghostscript's prn or pcl3's eprn device.

  Mixed Resolutions

Newer DeskJets are able to print with different resolutions for black and CMY on the same region of a page. For example, the best quality on a DeskJet 850C is achieved with 600 ppi for black and 300 ppi for CMY. This is not supported by pcl3. I suspect that implementing this really well in ghostscript is not a simple task.

  Performance for Larger Numbers of Intensity Levels

This could be improved by replacing some generic routines by more specialized ones for particular parameter values. There does not seem much sense in doing this, though, until I know that the code in question is needed for some printer model.

  Reliability

Hewlett-Packard does not publicly provide sufficiently detailed or accurate technical information to write a reliable PCL-3+ driver for all of its printers. The amount and quality of available information differs between printer models. As a consequence, pcl3 cannot provide the same level of reliability for all of its devices.

In my opinion the best-documented printers are those of the DeskJet-500 series. In addition, I have currently access to a DeskJet 850C which I have used for a number of experiments. Support for these printers should be considered to be the most reliable.

The next level of reliability belongs to the remaining printers for which subdevices exist. In these cases I had at least access to official HP documentation on supported media sizes and associated hardware margins and in addition for almost all cases some information on the supported PCL commands, sometimes complemented by PCL files generated by HP's official drivers and sent me by users.

The third level of reliability is associated with those printers for which people have sent success reports but for which I have no official information from HP.

With decreasing reliability it becomes increasingly probable that there is printer functionality which is not accessible through pcl3 (possibly only for the printer's own subdevice, you might get around that by using unspecold or unspec) or even that this driver generates PCL code not accepted by the printer.

  Photo Cartridges

From what I've heard, DeskJet printers with photo cartridges installed do not use a CMYK palette but instead one with 6 components. I have no official information on this interface. In addition, ghostscript does not currently support DeviceN as a native colour space.

  Cartridge Alignment

DeskJet printers with more than one ink cartridge present should usually be configured for the proper relative alignment of these cartridges. Apparently, this information is stored in not-immediately-volatile memory in the printer together with some settings (like the default media size) which are not relevant for printing with pcl3. As I do not have information on how this is done, you will need to use one of HP's programs for this purpose.

On a Linux system, try installing and running HP's DOS DeskJet control panel DJCP in the DOS emulator. DJCP should be present on one of the installation media you received with your printer. One user managed to get this to work for a DJ 670C with DOSEMU 0.98 under RedHat 5.2 by setting

    $_ports = "0x378 0x379"

in dosemu.conf. I was not successful on my Debian system.

The pcl3 distribution contains a file calign.ps which you can print if you wish to check to which extent the cartridges are aligned.

KNOWN BUGS

This is a beta release of pcl3. You must expect bugs although at present I do not know of any behaviour which can be clearly identified as a bug in pcl3.

However, there are two known bugs where the blame has not yet been definitely assigned to either the ghostscript kernel or pcl3:

•   If you specify an illegal ColourModel value, a core dump results.

•   For particular CMYK values, the colour becomes totally wrong. This disappears if you, e.g., modify the transfer functions slightly.

Both kinds of behaviour appear only in gs 6.01, not in gs 5.50.

You can also inspect the current bug list, available via pcl3's page on the web.

SEE ALSO

gs(1), pcl3opts(1)

A First Guide to PostScript (link to URL http://www.cs.indiana.edu/docproject/programming/postscript/postscript.html)

Adobe Systems, PostScript Language Reference (link to URL http://partners.adobe.com/asn/developer/PDFS/TN/PLRM.pdf) . Third edition, 1999.

AUTHOR

Copyright © 2000 by Martin Lottermoser, Greifswaldstraße 28, 38124 Braunschweig, Germany. E-mail: Martin.Lottermoser@t-online.de.

This is free software, released under the terms of the GNU Lesser General Public License (LGPL) (link to URL http://www.gnu.org/copyleft/lesser.html) , Version 2.1. USE IT AT YOUR OWN RISK.

pcl3 has a home page (link to URL http://home.t-online.de/home/Martin.Lottermoser/pcl3.html) on the web. Follow the links to the distribution directory.

Version of this reference page: $Revision: 1.13 $ ($Date: 2000/11/09 18:23:02 $).