| 1 |
******************************************************************************* |
| 2 |
File: @(#)$Id: README,v 1.10 2001/08/19 08:52:32 Martin Rel $ |
| 3 |
Contents: Notes on the PPD files in the pcl3 distribution |
| 4 |
Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig, |
| 5 |
Germany. E-mail: [email protected]. |
| 6 |
|
| 7 |
******************************************************************************* |
| 8 |
* * |
| 9 |
* Copyright (C) 2001 by Martin Lottermoser * |
| 10 |
* All rights reserved * |
| 11 |
* * |
| 12 |
******************************************************************************* |
| 13 |
|
| 14 |
|
| 15 |
Purpose and Format of PPD Files, Document Managers |
| 16 |
************************************************** |
| 17 |
Some PostScript commands (e.g., for duplex printing) are not concerned with |
| 18 |
what appears on the page but control the way a document is printed independent |
| 19 |
of its contents. Such commands are usually not created by the application |
| 20 |
generating the PostScript document but are inserted at the user's request when |
| 21 |
actually printing the file. In addition, some PostScript interpreters differ in |
| 22 |
the commands needed to achieve a particular effect, hence a PostScript file |
| 23 |
might have to be adapted for a certain device if it was orginally generated for |
| 24 |
a different one. This post-processing of PostScript files is the job of a |
| 25 |
PostScript "document manager" or "print manager". It obtains its information |
| 26 |
from a PPD (PostScript Printer Description) file for the printer selected. |
| 27 |
|
| 28 |
The most useful kind of document manager is a preprocessor for a spooler. This |
| 29 |
preprocessor parses the PostScript file to determine its current settings, asks |
| 30 |
the user which special features (e.g., duplex printing, output quality, |
| 31 |
stapling, etc.) are desired, extends or modifies the file with commands |
| 32 |
extracted from the PPD file, and passes the modified file to the spooler. |
| 33 |
|
| 34 |
There exist also spooler-integrated document managers where the user interface |
| 35 |
is detached from the editing component; in these cases the interface passes the |
| 36 |
information it has collected to the spooling interface in some spooler-specific |
| 37 |
manner and later a backend inserts appropriate PostScript commands. |
| 38 |
|
| 39 |
Primitive document manager implementations don't bother about parsing the |
| 40 |
PostScript file but merely prepend the new PostScript commands to the file; |
| 41 |
such commands will not take effect if the file already contains invocations of |
| 42 |
the same feature. Beware of this in particular in the case of Windows-generated |
| 43 |
PostScript files which usually contain explicit settings for the resolution. |
| 44 |
You might consider adding definitions for ghostscript's FIXEDRESOLUTION |
| 45 |
variable to the *Resolution statements in the PPD file if you have such a |
| 46 |
document manager. |
| 47 |
|
| 48 |
PPD files contain also some information which is relevant for software |
| 49 |
generating PostScript files. A case in point is the list of supported media |
| 50 |
sizes: it can be used by PostScript-generating programs to present a user with |
| 51 |
a list of choices for the document to be composed, and it is also used by the |
| 52 |
document manager to replace the size's invocation code with the commands |
| 53 |
required to obtain this size on the printer selected. It can be confusing if |
| 54 |
you have a PPD-based user interface to a print system which accepts PostScript |
| 55 |
as well as non-PostScript files and where the interface does not clearly |
| 56 |
distinguish between these two steps (document composition and printing); you |
| 57 |
might get the impression that you can alter the page size after the PostScript |
| 58 |
file has been generated. (A similar case is page orientation.) Actually, |
| 59 |
PostScript does provide functionality for doing this (PageSize recovery |
| 60 |
policies), but altering the size selection commands is logically wrong and does |
| 61 |
not give a usable result in general. |
| 62 |
|
| 63 |
The PPD file format is defined by Adobe: |
| 64 |
|
| 65 |
Adobe Systems Incorporated |
| 66 |
"PostScript Printer Description File Format Specification" |
| 67 |
Version 4.3 |
| 68 |
9 February 1996 |
| 69 |
Document ID: PN LPS5003 |
| 70 |
|
| 71 |
This specification can be obtained from http://www.adobe.com. |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
The PPD Files for pcl3 |
| 76 |
********************** |
| 77 |
The PPD files distributed with pcl3 are not complete descriptions of the |
| 78 |
devices implemented by ghostscript with the pcl3 driver. Their main purpose is |
| 79 |
to provide some essential support for document managers acting as |
| 80 |
preprocessors. This makes it possible to create printing interfaces which are |
| 81 |
easier to use than ghostscript's command line interface. As a consequence, |
| 82 |
you will find no *OpenUI/*CloseUI entries for device parameters like |
| 83 |
"SendBlackLast" or "PJLLanguage": the values of these parameters are not |
| 84 |
job-specific but printer-specific properties and should be given as additions |
| 85 |
in other PPD statements or in the call to ghostscript. |
| 86 |
|
| 87 |
PPD files can include other PPD files. For pcl3, the include structure looks |
| 88 |
like this (inclusion is from top to bottom): |
| 89 |
|
| 90 |
gs-pcl3-<subdevice>.ppd |
| 91 |
| |
| 92 |
gs-pcl3-common.ppd |
| 93 |
| |
| 94 |
gs.ppd |
| 95 |
| |
| 96 |
gs-<gs version>.ppd |
| 97 |
| |
| 98 |
gs-common.ppd |
| 99 |
|
| 100 |
Several of the files gs-pcl3-<subdevice>.ppd and in particular those where |
| 101 |
<subdevice> is not an acceptable argument to "-sSubdevice" are valid for |
| 102 |
several subdevices. If you are unsure which file to select, check the initial |
| 103 |
comments or the *ModelName statement in a file to discover the subdevices |
| 104 |
supported by that file. |
| 105 |
|
| 106 |
The gs-pcl3-<subdevice>.ppd files assume that the PostScript file generated by |
| 107 |
the document manager is passed to a ghostscript executable with options |
| 108 |
selecting pcl3 and the intended subdevice and without altering the default |
| 109 |
state of the device as far as it is reflected in the PPD file. If this does not |
| 110 |
agree with your environment, use a local PPD customization file for the |
| 111 |
necessary adaptations. |
| 112 |
|
| 113 |
If you're using CUPS, device and subdevice selection should happen via the |
| 114 |
*cupsFilter statement and the filter called. The gs-pcl3-<subdevice>.ppd files |
| 115 |
already contain *cupsFilter statements using the cups-pcl3 filter. If you're |
| 116 |
using a different filter, modify the statements as needed, otherwise read the |
| 117 |
initial comments in the file cups-pcl3. |
| 118 |
|
| 119 |
|
| 120 |
Installation of the Files |
| 121 |
************************* |
| 122 |
|
| 123 |
1. Create a file called gs.ppd for describing site-specific settings of your |
| 124 |
ghostscript installation. It should contain at least the following |
| 125 |
statements: |
| 126 |
|
| 127 |
*PPD-Adobe: "4.3" |
| 128 |
*DefaultPaperDimension: <size> |
| 129 |
*Include: "gs-<gs version>.ppd" |
| 130 |
|
| 131 |
Replace "<size>" with the default page size configured for your ghostscript |
| 132 |
installation. Usually, this is either "A4" or "Letter". In the case of A4 |
| 133 |
you would therefore write: |
| 134 |
|
| 135 |
*DefaultPaperDimension: A4 |
| 136 |
|
| 137 |
You might also wish to insert other statements here which describe settings |
| 138 |
which are relevant for a document manager. For example, if your document |
| 139 |
manager downloads fonts to the PostScript interpreter if it is of the |
| 140 |
opinion that the latter does not have a particular font used in a document |
| 141 |
(this is the case for CUPS), you should compose a PPD file with a list of |
| 142 |
fonts accessible to your ghostscript installation and insert it or an |
| 143 |
*Include statement for it at this point. You can use the fonts.ppd file in |
| 144 |
this directory as a model (or as a temporary substitute); it contains a |
| 145 |
list of ghostscript's usual standard fonts. If the programs accessing the |
| 146 |
PPD file use it only for determining whether a font is accessible to the |
| 147 |
interpreter or not, you can also simply use the list of font descriptions |
| 148 |
resulting from running gs on: |
| 149 |
|
| 150 |
/scratch 200 string def |
| 151 |
(*) |
| 152 |
{ |
| 153 |
(*Font ) print print (: Standard "\(0.0\)" Standard Disk\n) print |
| 154 |
} |
| 155 |
scratch /Font resourceforall |
| 156 |
|
| 157 |
(put this into a file and run "gs -q -dBATCH -sDEVICE=bit" on it). This |
| 158 |
output will contain information which is wrong, but it will list all fonts |
| 159 |
known to your ghostscript installation. |
| 160 |
|
| 161 |
Don't forget to also replace <gs version> with your ghostscript's version |
| 162 |
number. If there is no gs-<gs version>.ppd file for your gs version, use |
| 163 |
one of the existing gs-<gs version>.ppd files as a model. |
| 164 |
|
| 165 |
2. The PPD specification distinguishes between printer models (e.g., the |
| 166 |
HP DeskJet 540) and printer instances (e.g., the second printer in |
| 167 |
room 12). The PPD file for an instance can be generated by creating a local |
| 168 |
instance-specific customization file which includes the model's PPD file. |
| 169 |
|
| 170 |
If your document manager has an interface for instance installation, it is |
| 171 |
sufficient to give it the relevant gs-pcl3-<subdevice>.ppd files which |
| 172 |
describe models. Otherwise you usually have to create a customization file |
| 173 |
under the name of the instance, containing just |
| 174 |
|
| 175 |
*PPD-Adobe: "4.3" |
| 176 |
*ShortNickName: "<short text>" |
| 177 |
*NickName: "<text>" |
| 178 |
*Include: "gs-pcl3-<subdevice>.ppd" |
| 179 |
|
| 180 |
with <text> describing the printer instance (<short text> should basically |
| 181 |
have the same content but consist of at most 31 characters) and <subdevice> |
| 182 |
being replaced to generate the name of the pcl3 PPD file you wish to use |
| 183 |
for this printer. |
| 184 |
|
| 185 |
If you wish to extend or override other settings in the |
| 186 |
gs-pcl3-<subdevice>.ppd file, add these statements in the customization |
| 187 |
file between the first and the last statement above. |
| 188 |
|
| 189 |
The pcl3 PPD files contain *InputSlot definitions only for those media |
| 190 |
sources ("Cassette" and "ManualFeed") which are available independent of |
| 191 |
your "InputAttributes" definitions. If you configure a print queue such |
| 192 |
that other sources are available as well, read the comments on the |
| 193 |
*InputSlot entry in gs-pcl3-common.ppd. |
| 194 |
|
| 195 |
You can't use local customization files with CUPS up to at least version |
| 196 |
1.1.8 because the CUPS PPD scanner (a) does not support the *Include |
| 197 |
statement and (b) violates the PPD specification in either taking the |
| 198 |
last occurrence of a keyword as the correct instance or collecting all |
| 199 |
instances instead of disregarding every except the first. Modify the |
| 200 |
installed instance files in this case if you need some customization, for |
| 201 |
example to change the "*NickName" value (which actually CUPS should do when |
| 202 |
you give it a description for the print queue at creation time). |
| 203 |
|
| 204 |
3. Copy all PPD files needed into a directory where they will be found by your |
| 205 |
document manager. |
| 206 |
|
| 207 |
If your document manager does not support the "*Include" statement, use the |
| 208 |
script "catppd" for this purpose: |
| 209 |
|
| 210 |
catppd <top PPD file> <target directory or file> |
| 211 |
|
| 212 |
The script requires that all the files referenced from <top PPD file> must |
| 213 |
be accessible from the current working directory under the name given in |
| 214 |
the "*Include" statement. In the case of pcl3's PPD files this means that |
| 215 |
you must call it from the "ppd" directory. If you are installing model |
| 216 |
files you may specify any gs-pcl3-*.ppd file for <top PPD file> with the |
| 217 |
exception of gs-pcl3-common.ppd. If you are installing instance files, use |
| 218 |
catppd only on your customization files. |
| 219 |
|
| 220 |
For CUPS up to at least version 1.1.8 you'll have to use catppd and you |
| 221 |
should copy the files into the .../cups/model directory. You must also |
| 222 |
remove the second "*OpenUI *MediaType: ... *CloseUI *MediaType" section |
| 223 |
from the copied gs-pcl3-unspec.ppd file. |
| 224 |
|
| 225 |
4. If you are using the "unspec" or "unspecold" subdevices, check whether the |
| 226 |
PPD file supports all the features you need. You will also almost certainly |
| 227 |
find some features or values there which are not supported by your printer. |
| 228 |
It is probably best to create your own PPD file in this case. |