2
--------------------------------------
3
The X Print Service - The Basics
4
--------------------------------------
7
- 1.0 X Print Service Overview
9
- 2.0 How the X Print Service Works
11
- 3.0 Using the X Print Service
12
- 3.1 X Print Server Configuration
13
- 3.2 Starting the X Print Service
14
- 3.3 Configuring the environment
15
- 3.4 General End-User Sequence
18
1.0 X Print Service Overview
19
=============================
21
The "X Print Service" technology allows X rendering to devices such as
22
printers and fax. Most of the service is available in the X11
23
technology stack as Xp, with the remainder in the CDE technology stack
24
as DtPrint. Modifications have also been made to the Motif technology
25
stack to support Xp and DtPrint.
27
The Xp portion consists of:
28
* Xp Extension for the X-Server (included in the X-Server Xprt)
29
* Xp Extension API for the client side (libXp)
30
* PCL ddx driver that converts core X to native PCL
31
* Postscript ddx driver that converts core X to native Postscript
32
* Raster ddx driver that generates xwd rasters which can be
33
converted to PCL or Postscript rasters
35
The DtPrint portion consists of:
36
* A collection of print GUIs (libDtPrint)
37
* A Print Dialog Manager that can assist a client in
38
setting printing options (dtpdm, dtpdmd)
40
From an X clients perspective, it can attach to one of two nearly
41
identical X-Servers, a "Video" X-Server, and a "Print" X-Server
42
which has the additional Xp capability but otherwise looks and
47
2.0 How the X Print Service Works
48
==================================
50
The X Print Service expands on the traditional X-Server and Xlib world
53
1. Most obvious is the use of "print ddx drivers" instead of
54
"video ddx drivers". While a video ddx driver modifies pixels
55
in a video frame buffer, a print ddx driver generates "page
56
description language (PDL)" output such as PCL or Postscript.
58
Once a print ddx driver generates PDL output, it can be sent to
59
a spooler such as lp(1) or retrieved by the client.
61
Though not currently done, a single X-Server can support both
62
print and video ddx drivers.
64
2. Since printers support "paged" output, unlike video, a portion
65
of the Xp Extension supports APIs to delineate printed output.
66
For example, XpStartPage and XpEndPage tell the X-Server where
67
a physical page starts and ends in an otherwise continuous
68
stream of X rendering primitives. Likewise, XpStartJob and
69
XpEndJob determine when a collection of pages starts and ends.
70
XpEndJob typically causes the generated PDL to be submitted to
71
a spooler, such as lp(1).
73
3. Since printers have extensive capabilities, another portion of
74
the Xp Extension supports APIs to manipulate "print contexts".
76
Once a printer is selected using the Xp Extension API, a print
77
context to represent it can be created. A print context
78
embodies the printer selected - it contains the printer's
79
default capabilities, selectable range of capabilities,
80
printer state, and generated output. Some "attributes" within
81
the print context can be modified by the user, and the
82
X-Server and print ddx driver will react accordingly. For
83
example, the attribute "content-orientation" can be set to
84
"landscape" or "portrait".
86
4. Since printers can have "built in" fonts, the Xp Extension in
87
the X-Server works with the print ddx drivers to make
88
available (for printing only) additional fonts on a per print
91
When a print context is created and set for a given printer,
92
the X font calls may be able to access additional printer
93
fonts. To do this (typically), the X-Server must have access
94
to "printer metric files" (.pmf) that describe at minimum the
95
metrics of the built in fonts.
99
3.0 Using the X Print Service
100
==============================
102
There are three tasks to start the X Print Service: 1) configuring the
103
X Print Server, 2) starting the X Print Service, 3) configuring the user
104
session so that clients can find the running X Print Service.
106
The tasks are described in detail below.
109
3.1 X Print Server Configuration
110
---------------------------------
112
The X Print Server (Xprt) can read a number of configuration files which
113
control its behavior and support for printers. Each vendor platform has
114
a default location for this information. Xprt can also read the
115
environment variable XPCONFIGDIR to locate alternate configuration
116
directories. Common settings include:
118
* export XPCONFIGDIR=/X11/lib/X11/XpConfig/
120
* export XPCONFIGDIR=/proj/x11/xc/programs/Xserver/XpConfig/
122
Xprt has many built-in defaults, and lacking any configuration files,
123
will immediately try to support all printers visible via lpstat(1).
125
In order of importance for configuration by a system administrator, the
126
configuration files for a "C" locale are as follows.
128
${XPCONFIGDIR}/C/print/Xprinters
130
`Xprinters' is the top most configuration file. It tells
131
Xprt which specific printer names (e.g. mylaser) should
132
be supported, and whether lpstat(1) or other commands
133
should be used to automatically supplement the list of
136
${XPCONFIGDIR}/C/print/attributes/printer
138
The `printer' file maps printer names to model
139
configurations (see `model-config' below). For example,
140
"mylaser" could be mapped to a "HPDJ1600C", and all other
141
arbitrary printers could be mapped to a default, such as
142
"HPLJ4SI". When depending on lpstat(1) in the Xprinters
143
file, setting up defaults in `printer' becomes all the
146
${XPCONFIGDIR}/C/print/attributes/document
148
The `document' file specifies the initial document values
149
for any print jobs. For example, which paper tray to
150
use, what default resolution, etc.
152
${XPCONFIGDIR}/C/print/attributes/job
154
The `job' file specifies the initial job values for any
155
print jobs. For example, "notification-profile" can be
156
set so that when a print job is successfully sent to a
157
printer, e-mail is sent to the user.
159
${XPCONFIGDIR}/C/print/models/HPDJ1600C/model-config
160
${XPCONFIGDIR}/C/print/models/HPDJ1600C/fonts/fonts.dir
161
${XPCONFIGDIR}/C/print/models/HPDJ1600C/fonts/9nb00051.pmf
162
${XPCONFIGDIR}/C/print/models/HPDJ1600C/fonts/9nb00093.pmf
164
The `model-config' file has attributes that describe the
165
printer model's capabilities and default settings.
166
Printer model fonts may also be present. The model-config
167
file also identifies the print ddx driver to be used.
169
For each printer model supported, a complete hierarchy of
170
files should exist. In most cases, these files do not
173
${XPCONFIGDIR}/C/print/ddx-config/raster/pcl
174
${XPCONFIGDIR}/C/print/ddx-config/raster/postscript
176
The print ddx drivers can have highly specific
177
configuration files to control their behavior. In most
178
cases, these files do not need to be modified.
181
3.2 Starting the X Print Service
182
---------------------------------
184
The summary checklist for starting the X Print Service is as follows:
186
1. Choose an execution model for the X Print Service. The X
187
Print Service can be run on a per-user session basis, per
188
machine basis, or can be run on a few machines globally
189
available to a number of users.
191
2. If print jobs are to be submitted to a spooler (almost always
192
the case), make sure all needed printers are available to the
193
spooler subsystem (most often lp(1)) on the same machine
194
running the X Print Service.
196
3. Configure the X Print Server. See ``X Print Server
199
4. Depending on #1, start the X Print Server process "Xprt", and
200
then the Print Dialog Manager Daemon process "dtpdmd" at the
203
The details are described below.
205
Because the X Print Service is based on X, it can be easily distributed.
206
The most significant factors in which execution model to choose will be
209
* how many printers will be accessable through the printer
210
subsystem on any given machine. A system administrator may
211
choose to cluster printers on a few given machines, or
212
scatter them across an organization and possibly make
213
extensive use of remote spoolers to make them globally
216
* how many machines will need a copy of the X Print Server
217
configuration files. The files have been architected so
218
that one super-set version of them can be maintained and
219
distributed (e.g. via NFS), and a per-machine or per-user
220
version of the `Xprinters' is all that is needed to have the
221
appropriate information in them utilized or ignored.
223
* how many users can demand services from a given X Print
226
With the above in mind, some obvious execution models include:
228
* Global - in this model, the system administrator is choosing
229
to run the X Print Service on a *few* select machines with
230
appropriate printers configured, and allow clients access to
231
the global resource. This can centralize the administration
232
of printers and configuration files, but may have to be
233
monitored for performance loading.
235
Startup would likely be done by boot-up scripts.
237
* Per-machine - every machine with potential X Print Service
238
users would run the service. Printer and configuration file
239
administration is decentralized, and usage would be limited
240
to the users on the machine.
242
Startup would likely be done by boot-up scripts.
244
* Per-user session - every user would run an entire X Print
245
Service for themselves. In the future, the Video X Server
246
normally started may contain Print X Server capability, so
247
this model becomes very natural.
249
Startup would likely be done at session login or by
250
launching actions or processes manually once the user
251
logs in. Note: the dtpdmd must be started after Xprt.
253
Starting of the processes is straight forward. In strict order:
255
[machineA] % Xprt [-XpFile <Xprinters file>] [:dispNum] &
257
Note that Xprt will look for configuration files in either
258
a default location or where XPCONFIGDIR points.
260
-XpFile specifies an alternate `Xprinters' file, rather
261
than the default one or `${XPCONFIGDIR}/C/print/Xprinters'.
263
[machineA] % dtpdmd -d machineA[:dispNum] [-l /tmp/dtpdmd.log] &
265
The dtpdmd will maintain an X-Selection on the X-Server,
266
and will start dtpdm's as required to service requests.
268
In all but the per-user session model, the machine running the dtpdmd
269
(thus dtpdm's) will need display authorization to the users video
274
3.3 Configuring the environment
275
--------------------------------
277
Once a X Print Server and dtpdmd have been started -- many of them
278
in some cases -- clients will need to find and use them. There are
279
two mechanisms that allow clients to discover X Print Servers and
282
* "X Print Specifier" - assuming usage of the DtPrint print
283
dialogs, the following notation is understood:
285
printer_name@machine[:dispNum]
291
In the above example, the X Print Server running at `printhub:2'
292
is assumed to support the printer named `colorlj7'.
294
* "XPSERVERLIST" - assuming usage of the DtPrint print dialogs,
295
the environment variable "XPSERVERLIST" can contain a list
296
of X Print Servers. For example:
298
XPSERVERLIST="printhub:2 printhub:3 otherdept:0"
300
Then in the dialogs, only a printer name needs to be entered.
301
The dialog will then search the X Print Servers in XPSERVERLIST
302
for a server than supports the printer, and then establish
305
3.4 General End-User Sequence
306
------------------------------
308
From most CDEnext applications, printing is accomplished by bringing
309
down the <File> menu and selecting <Print...>. This will result in
310
the DtPrintSetupBox dialog, which will request the name of a printer,
311
and offer limited capability to configure print options (e.g. number
312
of copies). If the user wishes, they can select <Setup...>, which
313
will start a dtpdm capable of modifying additional print options.
314
Finally, the user should select <Print>.
318
$Xorg: README,v 1.3 2000/08/17 19:48:02 cpqbld Exp $