README
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: Martin.Lottermoser@t-online.de.
6
7*******************************************************************************
8* *
9* Copyright (C) 2001 by Martin Lottermoser *
10* All rights reserved *
11* *
12*******************************************************************************
13
14
15Purpose and Format of PPD Files, Document Managers
16**************************************************
17Some PostScript commands (e.g., for duplex printing) are not concerned with
18what appears on the page but control the way a document is printed independent
19of its contents. Such commands are usually not created by the application
20generating the PostScript document but are inserted at the user's request when
21actually printing the file. In addition, some PostScript interpreters differ in
22the commands needed to achieve a particular effect, hence a PostScript file
23might have to be adapted for a certain device if it was orginally generated for
24a different one. This post-processing of PostScript files is the job of a
25PostScript "document manager" or "print manager". It obtains its information
26from a PPD (PostScript Printer Description) file for the printer selected.
27
28The most useful kind of document manager is a preprocessor for a spooler. This
29preprocessor parses the PostScript file to determine its current settings, asks
30the user which special features (e.g., duplex printing, output quality,
31stapling, etc.) are desired, extends or modifies the file with commands
32extracted from the PPD file, and passes the modified file to the spooler.
33
34There exist also spooler-integrated document managers where the user interface
35is detached from the editing component; in these cases the interface passes the
36information it has collected to the spooling interface in some spooler-specific
37manner and later a backend inserts appropriate PostScript commands.
38
39Primitive document manager implementations don't bother about parsing the
40PostScript file but merely prepend the new PostScript commands to the file;
41such commands will not take effect if the file already contains invocations of
42the same feature. Beware of this in particular in the case of Windows-generated
43PostScript files which usually contain explicit settings for the resolution.
44You might consider adding definitions for ghostscript's FIXEDRESOLUTION
45variable to the *Resolution statements in the PPD file if you have such a
46document manager.
47
48PPD files contain also some information which is relevant for software
49generating PostScript files. A case in point is the list of supported media
50sizes: it can be used by PostScript-generating programs to present a user with
51a list of choices for the document to be composed, and it is also used by the
52document manager to replace the size's invocation code with the commands
53required to obtain this size on the printer selected. It can be confusing if
54you have a PPD-based user interface to a print system which accepts PostScript
55as well as non-PostScript files and where the interface does not clearly
56distinguish between these two steps (document composition and printing); you
57might get the impression that you can alter the page size after the PostScript
58file has been generated. (A similar case is page orientation.) Actually,
59PostScript does provide functionality for doing this (PageSize recovery
60policies), but altering the size selection commands is logically wrong and does
61not give a usable result in general.
62
63The 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
71This specification can be obtained from http://www.adobe.com.
72
73
74
75The PPD Files for pcl3
76**********************
77The PPD files distributed with pcl3 are not complete descriptions of the
78devices implemented by ghostscript with the pcl3 driver. Their main purpose is
79to provide some essential support for document managers acting as
80preprocessors. This makes it possible to create printing interfaces which are
81easier to use than ghostscript's command line interface. As a consequence,
82you will find no *OpenUI/*CloseUI entries for device parameters like
83"SendBlackLast" or "PJLLanguage": the values of these parameters are not
84job-specific but printer-specific properties and should be given as additions
85in other PPD statements or in the call to ghostscript.
86
87PPD files can include other PPD files. For pcl3, the include structure looks
88like 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
100Several of the files gs-pcl3-<subdevice>.ppd and in particular those where
101<subdevice> is not an acceptable argument to "-sSubdevice" are valid for
102several subdevices. If you are unsure which file to select, check the initial
103comments or the *ModelName statement in a file to discover the subdevices
104supported by that file.
105
106The gs-pcl3-<subdevice>.ppd files assume that the PostScript file generated by
107the document manager is passed to a ghostscript executable with options
108selecting pcl3 and the intended subdevice and without altering the default
109state of the device as far as it is reflected in the PPD file. If this does not
110agree with your environment, use a local PPD customization file for the
111necessary adaptations.
112
113If 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
115already contain *cupsFilter statements using the cups-pcl3 filter. If you're
116using a different filter, modify the statements as needed, otherwise read the
117initial comments in the file cups-pcl3.
118
119
120Installation of the Files
121*************************
122
1231. 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
1652. 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
2043. 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
2254. 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.
229