File: ps.html

package info (click to toggle)
cupsddk 1.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,488 kB
  • ctags: 1,125
  • sloc: ansic: 7,074; cpp: 5,423; makefile: 526; xml: 227; sh: 153
file content (171 lines) | stat: -rw-r--r-- 5,497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<html>
<body>

<div align='justify'>

<h1 align="right"><a name='PS_DRIVERS'>4 - Developing PostScript
Printer Drivers</a></h1>

<p>This chapter describes how to develop PPD files for
PostScript printer drivers.</p>

<h2>Overview of PostScript Driver Development</h2>

<p>The PPD compiler is capable of producing PPD files for
PostScript printers just as easily as for non-PostScript
printers. PostScript printer drivers use the <tt>ps</tt> driver
type:</p>

<pre>
    DriverType ps
</pre>

<h3>Required Attributes</h3>

<p>PostScript drivers require the attributes listed in <a
href='#TABLE4-1'>Table 4-1</a>. If not specified, the defaults
for CUPS drivers are used. A typical PostScript driver
information file would include the following attributes:</p>

<pre>
    Attribute DefaultColorSpace "" Gray
    Attribute LandscapeOrientation "" Minus90
    Attribute LanguageLevel "" "3"
    Attribute Product "" "(Foo LaserProofer 2000)"
    Attribute PSVersion "" "(3010) 0"
    Attribute TTRasterizer "" Type42
</pre>

<!-- NEW PAGE -->
<center><table border='1' cellpadding='5' cellspacing='0' width='90%'>
<caption align='bottom'><a name='TABLE4-1'><i>Table 4-1,
Required PostScript printer driver attributes</i></a></caption>
<tr bgcolor='#cccccc'>
	<th>Attribute</th>
	<th>Description</th>
</tr>
<tr>
	<td valign='top'><tt>DefaultColorSpace</tt></td>
	<td align='justify' valign='top'>The default colorspace:
	<tt>Gray</tt>, <tt>RGB</tt>, <tt>CMY</tt>, or
	<tt>CMYK</tt>. If not specified, then <tt>RGB</tt> is
	assumed.</td>
</tr>
<tr>
	<td valign='top'><tt>LandscapeOrientation</tt></td>
	<td align='justify' valign='top'>The preferred landscape
	orientation: <tt>Plus90</tt>, <tt>Minus90</tt>, or
	<tt>Any</tt>. If not specified, <tt>Plus90</tt> is
	assumed.</td>
</tr>
<tr>
	<td valign='top'><tt>LanguageLevel</tt></td>
	<td align='justify' valign='top'>The PostScript language
	level supported by the device: 1, 2, or 3. If not
	specified, 2 is assumed.</td>
</tr>
<tr>
	<td valign='top'><tt>Product</tt></td>
	<td align='justify' valign='top'>The string returned by
	the PostScript <tt>product</tt> operator, which
	<i>must</i> include parenthesis to conform with
	PostScript syntax rules for strings. Multiple
	<tt>Product</tt> attributes may be specified to support
	multiple products with the same PPD file. If not
	specified, "(ESP Ghostscript)" and "(GNU Ghostscript)"
	are assumed.</td>
</tr>
<tr>
	<td valign='top'><tt>PSVersion</tt></td>
	<td align='justify' valign='top'>The PostScript
	interpreter version numbers as returned by the
	<tt>version</tt> and <tt>revision</tt> operators. The
	required format is "(version) revision". Multiple
	<tt>PSVersion</tt> attributes may be specified to
	support multiple interpreter version numbers. If not
	specified, "(3010) 705" and "(3010) 707" are
	assumed.</td>
</tr>
<tr>
	<td valign='top'><tt>TTRasterizer</tt></td>
	<td align='justify' valign='top'>The type of TrueType
	font rasterizer supported by the device, if any. The
	supported values are <tt>None</tt>, <tt>Accept68k</tt>,
	<tt>Type42</tt>, and <tt>TrueImage</tt>. If not
	specified, <tt>None</tt> is assumed.</td>
</tr>
</table></center>

<h3>Query Commands</h3>

<p>Most PostScript printer PPD files include query commands
(<tt>?PageSize</tt>, etc.) that allow applications to query the
printer for its current settings and configuration. Query
commands are included in driver information files as attributes.
For example, the query command for the <tt>PageSize</tt> option
might look like the following:</p>

<pre>
    Attribute "?PageSize" "" "
          save
          currentpagedevice /PageSize get aload pop
          2 copy gt {exch} if (Unknown)
          23 dict
                  dup [612 792] (Letter) put
                  dup [612 1008] (Legal) put
                  dup [595 842] (A4) put
                  {exch aload pop 4 index sub abs 5 le exch 
                   5 index sub abs 5 le and
                  {exch pop exit} {pop} ifelse
          } bind forall = flush pop pop
          restore"
</pre>

<p>Query commands can span multiple lines, however no single
line may contain more than 255 characters.</p>

<h3>Adding Filters</h3>

<p>Normally a PostScript printer driver will not utilize any
additional print filters. For drivers that provide additional
filters such as a CUPS command file filter for doing printer
maintenance, you must also list the following <tt>Filter</tt>
directive to handle printing PostScript files:</p>

<pre>
    Filter application/vnd.cups-postscript 0 -
</pre>

<h2>Importing Existing PostScript Drivers</h2>

<p>The <tt>ppdi(1)</tt> utility included with the CUPS DDK
imports existing PPD files into driver information files. This
allows you to make modifications and localize PPD files for
other languages with great ease. Use the following command to
import a single PPD file called <var>filename.ppd</var> into a
driver information file called <var>filename.drv</var>:</p>

<pre>
    <kbd>ppdi filename.drv filename.ppd ENTER</kbd>
</pre>

<p>The driver information file is created if it does not exist.
Otherwise the PPD file information is appended to the end of the
file. You can use shell wildcards to import whole directories of
PPD files:</p>

<pre>
    <kbd>ppdi filename.drv *.ppd ENTER</kbd>
</pre>

<p>Once imported, you can edit the driver information file and
use the <tt>ppdc</tt> program to regenerate the PPD files:</p>

<pre>
    <kbd>ppdc filename.drv ENTER</kbd>
</pre>

</div>

</body>
</html>