|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/cups/doc/help/ |
Upload File : |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- SECTION: Specifications -->
<head>
<title>CUPS PPD Extensions</title>
<meta name='keywords' content='Programming, PostScript Printer Description'>
<link rel='stylesheet' type='text/css' href='../cups.css'>
</head>
<body>
<!--
"$Id: spec-ppd.html 6158 2006-12-17 01:44:21Z mike $"
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
Copyright 1997-2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
property of Easy Software Products and are protected by Federal
copyright law. Distribution and use rights are outlined in the file
"LICENSE.txt" which should have been included with this file. If this
file is missing or damaged please contact Easy Software Products
at:
Attn: CUPS Licensing Information
Easy Software Products
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636 USA
Voice: (301) 373-9600
EMail: cups-info@cups.org
WWW: http://www.cups.org
-->
<h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
<p>This specification describes the attributes and extensions
that CUPS adds to <a
href="http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf">
Adobe TechNote #5003: PostScript Printer Description File Format
Specification Version 4.3</a>. PostScript Printer Description
("PPD") files describe the capabilities of each printer and are
used by CUPS to support printer-specific features and intelligent
filtering.</p>
<h2 class='title'><a name='SYNTAX'>PPD File Syntax</a></h2>
<p>The PPD format is text-based and uses lines of up to 255
characters terminated by a carriage return, linefeed, or
combination of carriage return and line feed. The following ABNF
definition [RFC2234] defines the general format of lines in a PPD
file:</p>
<pre class='command'>
PPD-FILE = HEADER +(DATA / COMMENT / LINE-END)
HEADER = "*" 0x50.50.44.2D.41.64.6F.62.65 ":" ; *PPD-Adobe:
*WSP DQUOTE "4.3" DQUOTE LINE-END
COMMENT = "*%" *TCHAR LINE-END
DATA = "*" 1*KCHAR [ WSP 1*KCHAR [ "/" 1*TCHAR ] ] ":"
1*(*WSP VALUE) LINE-END
VALUE = 1*TCHAR / DQUOTE 1*SCHAR DQUOTE
KCHAR = ALPHA / DIGIT / "_" / "." / "-"
SCHAR = LINE-END / WSP / %x21 / %x23-7E / %xA0-FF
TCHAR = %x20-7E / %xA0-FF
LINE-END = CR / LF / CR LF
</pre>
<h2 class='title'><a name='ATTRIBUTES'>General Attributes</a></h2>
<h3>APBookFile</h3>
<p class='summary'>*APBookFile: "file URL"</p>
<p>This string attribute specifies the Apple help book file to use
for this printer driver.</p>
<p>Example:</p>
<pre class='command'>
*APBookFile: "file:///Library/Printers/vendor/Help/filename"
</pre>
<h3>APDuplexRequiresFlippedMargin</h3>
<p class='summary'>*APDuplexRequiresFlippedMargin: boolean</p>
<p>This boolean attribute notifies the RIP filters that the
destination printer does not require the top and bottom margins
of the <tt>ImageableArea</tt> swapped for the back page. The
default is <tt>true</tt> when <tt>cupsFlipDuplex</tt> is <tt>true</tt> and <tt>false</tt> otherwise.</p>
<p>Example:</p>
<pre class='command'>
<em>*% Flip the back side images</em>
*cupsFlipDuplex: true
<em>*% Don't swap the top and bottom margins for the back side</em>
*APDuplexRequiresFlippedMargin: false
</pre>
<p>Also see the related <tt>cupsFlipDuplex</tt> attribute.</p>
<h3>cupsEvenDuplex</h3>
<p class='summary'>*cupsEvenDuplex: boolean</p>
<p>This boolean attribute notifies the RIP filters that the
destination printer requires an even number of pages when 2-sided
printing is selected. The default value is <code>false</code>.</p>
<p>Example:</p>
<pre class='command'>
<em>*% Always send an even number of pages when duplexing</em>
*cupsEvenDuplex: true
</pre>
<h3>cupsFilter</h3>
<p class='summary'>*cupsFilter: "source/type cost program"</p>
<p>This string attribute provides a conversion rule from the
given source type to the printer's native format using the
filter "program". If a printer supports the source type directly,
the special filter program "-" may be specified.</p>
<p>Examples:</p>
<pre class='command'>
<em>*% Standard raster printer driver filter</em>
*cupsFilter: "application/vnd.cups-raster 100 rastertofoo"
<em>*% Plain text filter</em>
*cupsFilter: "text/plain 10 texttofoo"
<em>*% Pass-through filter for PostScript printers</em>
*cupsFilter: "application/vnd.cups-postscript 0 -"
</pre>
<h3>cupsFlipDuplex</h3>
<p class='summary'>*cupsFlipDuplex: boolean</p>
<p>This boolean attribute notifies the RIP filters that the
destination printer requires an upside-down image for the back
page. The default value is <code>false</code>.</p>
<p>Example:</p>
<pre class='command'>
<em>*% Flip the page image for the back side of duplexed output</em>
*cupsFlipDuplex: true
</pre>
<p>Also see the related <tt>APDuplexRequiresFlippedMargins</tt>
attribute.</p>
<h3>cupsIPPReason</h3>
<p class='summary'>*cupsIPPReason reason/Reason Text: "optional URIs"</p>
<p>This optional attribute maps custom
<code>printer-state-reasons</code> keywords that are generated by
the driver to human readable text. The optional URIs string
contains zero or more URIs separated by a newline. Each URI can
be a CUPS server absolute path to a help file under the
scheduler's <code>DocumentRoot</code> directory, a full HTTP URL
("http://www.domain.com/path/to/help/page.html"), or any other
valid URI which directs the user at additional information
concerning the condition that is being reported.</p>
<p>Examples:</p>
<pre class='command'>
<em>*% Map com.vendor-error to text but no page</em>
*cupsIPPReason com.vendor-error/A serious error occurred: ""
<em>*% Map com.vendor-error to text and a local page</em>
*cupsIPPReason com.vendor-error/A serious error occurred: "/help/com.vendor/error.html"
<em>*% Map com.vendor-error to text and a remote page</em>
*cupsIPPReason com.vendor-error/A serious error occurred: "http://www.vendor.com/help"
<em>*% Map com.vendor-error to text and a local, Apple help book, and remote page</em>
*APHelpBook: "file:///Library/Printers/vendor/Help/filename"
*cupsIPPReason com.vendor-error/A serious error occurred: "/help/com.vendor/error.html
help:anchor='com.vendor-error'%20bookID=Vendor%20Help
http://www.vendor.com/help"
*End
</pre>
<h3>cupsLanguages</h3>
<p class='summary'>*cupsLanguages: "locale list"</p>
<p>This attribute describes which language localizations are
included in the PPD. The "locale list" string is a space-delimited
list of locale names ("en", "en_US", "fr_FR", etc.)</p>
<p>Example:</p>
<pre class='command'>
<em>*% Specify Canadian, UK, and US English, and Candian and French French</em>
*cupsLanguages: "en_CA en_UK en_US fr_CA fr_FR"
</pre>
<h3>cupsManualCopies</h3>
<p class='summary'>*cupsManualCopies: boolean</p>
<p>This boolean attribute notifies the RIP filters that the
destination printer does not support copy generation in
hardware. The default value is <code>false</code>.</p>
<p>Example:</p>
<pre class='command'>
<em>*% Tell the RIP filters to generate the copies for us</em>
*cupsManualCopies: true
</pre>
<h3>cupsModelNumber</h3>
<p class='summary'>*cupsModelNumber: number</p>
<p>This integer attribute specifies a printer-specific model
number. This number can be used by a filter program to adjust
the output for a specific model of printer.</p>
<p>Example:</p>
<pre class='command'>
<em>*% Specify an integer for a driver-specific model number</em>
*cupsModelNumber: 1234
</pre>
<h3>cupsPortMonitor</h3>
<p class='summary'>*cupsPortMonitor urischeme/Descriptive Text: "port monitor"</p>
<p>This string attribute specifies printer-specific "port
monitor" filters that may be used with the printer. The CUPS
scheduler also looks for the <tt>Protocols</tt> attribute to see
if the <tt>BCP</tt> or <tt>TBCP</tt> protocols are supported. If
so, the corresponding port monitor ("bcp" and "tbcp",
respectively) is listed in the printer's
<tt>port-monitor-supported</tt> attribute.</p>
<p>The "urischeme" portion of the attribute specifies the URI scheme
that this port monitor should be used for. Typically this is used to
pre-select a particular port monitor for each type of connection that
is supported by the printer. The "port monitor" string can be "none"
to disable the port monitor for the given URI scheme.</p>
<p>Examples:</p>
<pre class='command'>
<em>*% Specify a PostScript printer that supports the TBCP protocol</em>
*Protocols: TBCP PJL
<em>*% Specify that TBCP should be used for socket connections but not USB</em>
*cupsPortMonitor socket/AppSocket Printing: "tbcp"
*cupsPortMonitor usb/USB Printing: "none"
<em>*% Specify a printer-specific port monitor for an Epson USB printer</em>
*cupsPortMonitor usb/USB Status Monitor: "epson-usb"
</pre>
<h3>cupsVersion</h3>
<p class='summary'>*cupsVersion: major.minor</p>
<p>This required attribute describes which version of the CUPS
PPD file extensions was used. Currently it must be the string
"1.0", "1.1", or "1.2".</p>
<p>Example:</p>
<pre class='command'>
<em>*% Specify a CUPS 1.2 driver</em>
*cupsVersion: "1.2"
</pre>
<h2 class='title'><a name='OPTIONS'>Custom Options</a></h2>
<p>CUPS supports custom options using an extension of the
<tt>CustomPageSize</tt> and <tt>ParamCustomPageSize</tt>
syntax:</p>
<pre class='command'>
*CustomFoo True: "command"
*ParamCustomFoo Name1/Text 1: order type minimum maximum
*ParamCustomFoo Name2/Text 2: order type minimum maximum
...
*ParamCustomFoo NameN/Text N: order type minimum maximum
</pre>
<p>When the base option is part of the <tt>JCLSetup</tt> section,
the "command" string contains JCL commands with "\order"
placeholders for each numbered parameter. The CUPS API handles
any necessary value quoting for HP-PJL commands. For example, if
the JCL command string is "@PJL SET PASSCODE=\1" and the first
option value is "1234" then CUPS will output the string
"@PJL SET PASSCODE=1234".</p>
<p>For non-<tt>JCLSetup</tt> options, the "order" value is a
number from 1 to N and specifies the order of values as they are
placed on the stack before the command. For example, if the
PostScript command string is
"<</cupsReal1 2 1 roll>>setpagedevice" and the
option value is "2.0" then CUPS will output the string
"2.0 <</cupsReal1 2 1 roll>>setpagedevice".</p>
<p>The "type" is one of the following keywords:</p>
<ul>
<li><tt>curve</tt> - a real value from "minimum" to
"maximum" representing a gamma correction curve using the
function: f(x) = x <sup>value</sup></li>
<li><tt>int</tt> - an integer value from "minimum" to
"maximum"</li>
<li><tt>invcurve</tt> - a real value from "minimum" to
"maximum" representing a gamma correction curve using the
function: f(x) = x <sup>1 / value</sup></li>
<li><tt>passcode</tt> - a string of numbers value with a
minimum of "minimum" numbers and a maximum of "maximum"
numbers ("minimum" and "maximum" are numbers and passcode
strings are not displayed in the user interface)</li>
<li><tt>password</tt> - a string value with a minimum of
"minimum" characters and a maximum of "maximum"
characters ("minimum" and "maximum" are numbers and password
strings are not displayed in the user interface)</li>
<li><tt>points</tt> - a measurement value in points from
"minimum" to "maximum"</li>
<li><tt>real</tt> - a real value from "minimum" to
"maximum"</li>
<li><tt>string</tt> - a string value with a minimum of
"minimum" characters and a maximum of "maximum"
characters ("minimum" and "maximum" are numbers)</li>
</ul>
<p>Examples:</p>
<pre class='command'>
<em>*% Base JCL key code option</em>
*OpenUI JCLPasscode/Key Code: PickOne
*OrderDependency: 10 JCLSetup *JCLPasscode
*DefaultJCLPasscode: None
*JCLPasscode None/No Code: ""
*JCLPasscode 1111: "@PJL SET PASSCODE = 1111<0A>"
*JCLPasscode 2222: "@PJL SET PASSCODE = 2222<0A>"
*JCLPasscode 3333: "@PJL SET PASSCODE = 3333<0A>"
*JCLCloseUI: *JCLPasscode
<em>*% Custom JCL key code option</em>
*CustomJCLPasscode True: "@PJL SET PASSCODE = \1<0A>"
*ParamCustomJCLPasscode Code/Key Code: 1 passcode 4 4
<em>*% Base PostScript watermark option</em>
*OpenUI WatermarkText/Watermark Text: PickOne
*OrderDependency: 10 AnySetup *WatermarkText
*DefaultWatermarkText: None
*WatermarkText None: ""
*WatermarkText Draft: "<</cupsString1(Draft)>>setpagedevice"
*CloseUI: *WatermarkText
<em>*% Custom PostScript watermark option</em>
*CustomWatermarkText True: "<</cupsString1 3 -1 roll>>setpagedevice"
*ParamCustomWatermarkText Text: 1 string 0 32
<em>*% Base PostScript gamma/density option</em>
*OpenUI GammaDensity/Gamma and Density: PickOne
*OrderDependency: 10 AnySetup *GammaDensity
*DefaultGammaDensity: Normal
*GammaDensity Normal/Normal: "<</cupsReal1 1.0/cupsReal2 1.0>>setpagedevice"
*GammaDensity Light/Lighter: "<</cupsReal1 0.9/cupsReal2 0.67>>setpagedevice"
*GammaDensity Dark/Darker: "<</cupsReal1 1.1/cupsReal2 1.5>>setpagedevice"
*CloseUI: *GammaDensity
<em>*% Custom PostScript gamma/density option</em>
*CustomGammaDensity True: "<</cupsReal1 3 -1 roll/cupsReal2 5 -1>>setpagedevice"
*ParamCustomGammaDensity Gamma: 1 curve 0.1 10
*ParamCustomGammaDensity Density: 2 real 0 2
</pre>
<h2 class='title'><a name='PROFILES'>Color Profiles</a></h2>
<p>CUPS supports two types of color profiles. The first type is
based on sRGB and is used by the standard CUPS raster filters and
ESP Ghostscript. The second type is based on ICC profiles and is
used by the Core Graphics-based filters on MacOS X.</p>
<blockquote><b>Note:</b> At this time, none of the CUPS raster
filters support ICC profiles. This will be addressed as time
and resources permit.</blockquote>
<h3>cupsColorProfile</h3>
<p class='summary'>*cupsColorProfile Resolution/MediaType: "density
gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"</p>
<p>This string attribute specifies an sRGB-based color profile
consisting of gamma and density controls and a 3x3 CMY color
transform matrix.</p>
<p>The <i>Resolution</i> and <i>MediaType</i> values may be "-"
to act as a wildcard. Otherwise they must match one of the
<tt>Resolution</tt> or <tt>MediaType</tt> attributes defined in
the PPD file.</p>
<p>The <i>density</i> and <i>gamma</i> values define gamma and
density adjustment function such that:</p>
<pre class='command'>
f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
</pre>
<p>The <i>m00</i> through <i>m22</i> values define a 3x3
transformation matrix for the CMY color values. The density
function is applied <i>after</i> the CMY transformation:</p>
<pre class='command'>
| m00 m01 m02 |
| m10 m11 m12 |
| m20 m21 m22 |
</pre>
<p>Examples:</p>
<pre class='command'>
<em>*% Specify a profile for printing at 360dpi on all media types</em>
*cupsColorProfile 360dpi/-: "1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
<em>*% Specify a profile for printing at 720dpi on Glossy media</em>
*cupsColorProfile 720dpi/Glossy: "1.0 2.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
<em>*% Specify a default profile for printing at all other resolutions and media types</em>
*cupsColorProfile -/-: "0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
</pre>
<h3>cupsICCProfile</h3>
<p class='summary'>*cupsICCProfile
ColorModel.MediaType.Resolution/Description: "filename"</p>
<p>This attribute specifies an ICC color profile that is
used to convert the document colors to the device
colorspace. The <tt>ColorModel</tt>, <tt>MediaType</tt>, and
<tt>Resolution</tt> keywords specify a selector for color
profiles. If omitted, the color profile will match any option
keyword for the corresponding main keyword.</p>
<p>The <tt>Description</tt> specifies human-readable text that
is associated with the color profile. The <tt>filename</tt>
portion specifies the ICC color profile to use; if the filename
is not absolute, it is loaded relative to the
<var>/usr/share/cups/profiles</var> directory.</p>
<p>Examples:</p>
<pre class='command'>
<em>*% Specify a profile for CMYK printing at 360dpi on all media types</em>
*cupsICCProfile CMYK..360dpi/360dpi CMYK: "vendor/foo-360-cmyk.icc"
<em>*% Specify a profile for RGB printing at 720dpi on Glossy media</em>
*cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "vendor/foo-720-glossy-rgb.icc"
<em>*% Specify a default profile for printing at all other resolutions and media types</em>
*cupsICCProfile ../Default: "vendor/foo-default.icc"
</pre>
<h4>Customizing the Profile Selection Keywords</h4>
<p>The <tt>MediaType</tt> and <tt>Resolution</tt> keywords can be
reassigned to different main keywords, allowing drivers to do
color profile selection based on different parameters. The
<tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt>
attributes define the mapping from selector to main keyword:</p>
<pre class='command'>
*cupsICCQualifier2: MainKeyword2
*cupsICCQualifier3: MainKeyword3
</pre>
<p>The default mapping is as follows:</p>
<pre class='command'>
*cupsICCQualifier2: MediaType
*cupsICCQualifier3: Resolution
</pre>
<h2 class='title'><a name='I18N'>Globalized PPD Support</a></h2>
<p>CUPS 1.2 and higher adds support for PPD files containing multiple
languages by following the following additional rules:</p>
<ol>
<li>The <tt>LanguageVersion</tt> MUST be <tt>English</tt></li>
<li>The <tt>LanguageEncoding</tt> MUST be <tt>ISOLatin1</tt></li>
<li>The <tt>cupsLanguages</tt> attribute MUST be provided and
list each of the supported locales in the PPD file</li>
<li>Main and option keywords MUST NOT exceed 34 (instead of 40)
characters to allow room for the locale prefixes in translation
attributes</li>
<li>The main keyword "Translation" MUST NOT be used</li>
<li>Translation strings included with the main and option
keywords MUST NOT contain characters outside the ASCII
subset of ISOLatin1 and UTF-8; developers wishing to use
characters outside ASCII MUST provide a separate set of
English localization attributes for the affected keywords.</li>
<li>Localizations are specified using a locale prefix of
the form "ll" or "ll_CC." where "ll" is the 2-letter ISO
language code and "CC" is the 2-letter ISO country
code</li>
<li>Locale-specific translation strings MUST be encoded
using UTF-8.</li>
<li>Main keywords MUST be localized using one of the
following forms:
<p><tt>*ll.Translation MainKeyword/translation
text: ""</tt><br />
<tt>*ll_CC.Translation MainKeyword/translation
text: ""</tt></p></li>
<li>Option keywords MUST be localized using one of the
following forms:
<p><tt>*ll.MainKeyword OptionKeyword/translation
text: ""</tt><br />
<tt>*ll_CC.MainKeyword OptionKeyword/translation
text: ""</tt></p></li>
<li>Localization attributes MAY appear anywhere after the
first line of the PPD file</li>
</ol>
<blockquote><b>Note:</b>
We use a <tt>LanguageEncoding</tt> value of <tt>ISOLatin1</tt>
and limit the allowed base translation strings to ASCII to avoid
character coding issues that would otherwise occur. In addition,
requiring the base translation strings to be in English allows
for easier fallback translation when no localization is provided
in the PPD file for a given locale.</blockquote>
<p>Examples:</p>
<pre class='command'>
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*cupsLanguages: "de_DE fr_FR"
*ModelName: "Foobar Laser 9999"
<em>*% Localize ModelName for French and German</em>
*fr_FR.Translation ModelName/La Foobar Laser 9999: ""
*de_DE.Translation ModelName/Foobar LaserDrucken 9999: ""
*cupsIPPReason com.vendor-error/A serious error occurred: "/help/com.vendor/error.html"
<em>*% Localize printer-state-reason for French and German</em>
*fr_FR.cupsIPPReason com.vendor-error/Une erreur sèrieuse s'est produite: "/help/com.vendor/error.html"
*de_DE.cupsIPPReason com.vendor-error/Eine ernste Störung trat: "/help/com.vendor/error.html"
...
*OpenUI *InputSlot/Paper Source: PickOne
*OrderDependency: 10 AnySetup *InputSlot
*DefaultInputSlot: Auto
<em>*% Localize InputSlot for French and German</em>
*fr_FR.Translation InputSlot/Papier source: ""
*de_DE.Translation InputSlot/Papiereinzug: ""
*InputSlot Auto/Default: "<</ManualFeed false>>setpagedevice"
<em>*% Localize InputSlot=Auto for French and German</em>
*fr_FR.InputSlot Auto/Par Defaut: ""
*de_DE.InputSlot Auto/Standard: ""
*InputSlot Manual/Manual Feed: "<</ManualFeed true>>setpagedevice"
<em>*% Localize InputSlot=Manual for French and German</em>
*fr_FR.InputSlot Manual/Manuel mecanisme de alimentation: ""
*de_DE.InputSlot Manual/Manueller Einzug: ""
*CloseUI: *InputSlot
</pre>
<h2 class='title'><a name='RASTERPS'>Writing PostScript Option Commands for Raster Drivers</a></h2>
<p>PPD files are used for both PostScript and non-PostScript printers. For CUPS raster drivers, you use a subset of the PostScript language to set page device attributes such as page size, resolution, and so forth. For example, the following code sets the page size to A4 size:</p>
<pre class='command'>
*PageSize A4: "<</PageSize[595 842]>>setpagedevice"
</pre>
<p>Custom options typically use other operators to organize the values into a key/value dictionary for <tt>setpagedevice</tt>. For example, our previous <tt>CustomWatermarkText</tt> option code uses the <tt>roll</tt> operator to move the custom string value into the dictionary for <tt>setpagedevice</tt>:</p>
<pre class='command'>
*CustomWatermarkText True: "<</cupsString1 3 -1 roll>>setpagedevice"
</pre>
<p>For a custom string value of "My Watermark", CUPS will produce the following PostScript code for the option:</p>
<pre class='command'>
(My Watermark)
<</cupsString1 3 -1 roll>>setpagedevice
</pre>
<p>The code moves the string value ("My Watermark") from the bottom of the stack to the top, creating a dictionary that looks like:</p>
<pre class='command'>
<</cupsString1(My Watermark)>>setpagedevice
</pre>
<p>The resulting dictionary sets the page device attributes that are sent to your raster driver in the page header.</p>
<h3>Supported PostScript Operators</h3>
<p>CUPS supports the following PostScript operators in addition to the usual PostScript number, string (literal and hex-encoded), boolean, null, and name values:</p>
<ul>
<li><tt><<</tt> - Start a dictionary.</li>
<li><tt>>></tt> - End a dictionary.</li>
<li><tt>[</tt> - Start an array.</li>
<li><tt>]</tt> - End an array.</li>
<li><tt>copy</tt> - Copy the top N objects on the stack.</li>
<li><tt>dup</tt> - Copy the top object on the stack.</li>
<li><tt>index</tt> - Copy the Nth from the top object on the stack.</li>
<li><tt>pop</tt> - Pop the top object on the stack.</li>
<li><tt>roll</tt> - Shift the top N objects on the stack.</li>
<li><tt>setpagedevice</tt> - Set the page header values according to the key/value dictionary on the stack.</li>
</ul>
<h3>Supported Page Device Attributes</h3>
<p>Table 1 shows the supported page device attributes along with PostScript code examples.</p>
<div class='table'>
<table summary='Supported Page Device Attributes'>
<caption>Table 1: <a name='TABLE_1'>Supported Page Device Attributes</a></caption>
<thead>
<tr>
<th>Name(s)</th>
<th>Type</th>
<th>Description</th>
<th>Example(s)</th>
</tr>
</thead>
<tbody>
<tr valign='top'>
<td><tt>AdvanceDistance</tt></td>
<td>Integer</td>
<td>Specifies the number of points to advance roll media after printing.</td>
<td><tt><</AdvanceDistance 18>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>AdvanceMedia</tt></td>
<td>Integer</td>
<td>Specifies when to advance the media: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page.</td>
<td><tt><</AdvanceMedia 4>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>Collate</tt></td>
<td>Boolean</td>
<td>Specifies whether collated copies are required.</td>
<td><tt><</Collate true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>CutMedia</tt></td>
<td>Integer</td>
<td>Specifies when to cut the media: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page.</td>
<td><tt><</CutMedia 1>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>Duplex</tt></td>
<td>Boolean</td>
<td>Specifies whether 2-sided printing is required.</td>
<td><tt><</Duplex true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>HWResolution</tt></td>
<td>Integer Array</td>
<td>Specifies the resolution of the page image in pixels per inch.</td>
<td><tt><</HWResolution[1200 1200]>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>InsertSheet</tt></td>
<td>Boolean</td>
<td>Specifies whether to insert a blank sheet before the job.</td>
<td><tt><</InsertSheet true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>Jog</tt></td>
<td>Integer</td>
<td>Specifies when to shift the media in the output bin: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page.</td>
<td><tt><</Jog 2>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>LeadingEdge</tt></td>
<td>Integer</td>
<td>Specifies the leading edge of the media: 0 = top, 1 = right, 2 = bottom, 3 = left.</td>
<td><tt><</LeadingEdge 0>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>ManualFeed</tt></td>
<td>Boolean</td>
<td>Specifies whether media should be drawn from the manual feed tray. Note: The <tt>MediaPosition</tt> attribute is preferred over the <tt>ManualFeed</tt> attribute.</td>
<td><tt><</ManualFeed true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>MediaClass</tt></td>
<td>String</td>
<td>Specifies a named media.</td>
<td><tt><</MediaClass (Invoices)>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>MediaColor</tt></td>
<td>String</td>
<td>Specifies the color of the media.</td>
<td><tt><</MediaColor >>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>MediaPosition</tt></td>
<td>Integer</td>
<td>Specifies the tray or source of the media.</td>
<td><tt><</MediaPosition 12>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>MediaType</tt></td>
<td>String</td>
<td>Specifies the general media type.</td>
<td><tt><</MediaType (Glossy)>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>MediaWeight</tt></td>
<td>Integer</td>
<td>Specifies the media weight in grams per meter<sup>2</sup>.</td>
<td><tt><</MediaWeight 100>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>MirrorPrint</tt></td>
<td>Boolean</td>
<td>Specifies whether to flip the output image horizontally.</td>
<td><tt><</MirrorPrint true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>NegativePrint</tt></td>
<td>Boolean</td>
<td>Specifies whether to invert the output image.</td>
<td><tt><</NegativePrint true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>NumCopies</tt></td>
<td>Integer</td>
<td>Specifies the number of copies to produce of each page.</td>
<td><tt><</NumCopies 100>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>Orientation</tt></td>
<td>Integer</td>
<td>Specifies the orientation of the output: 0 = portrait, 1 = landscape rotated counter-clockwise, 2 = upside-down, 3 = landscape rotated clockwise.</td>
<td><tt><</Orientation 3>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>OutputFaceUp</tt></td>
<td>Boolean</td>
<td>Specifies whether to place the media face-up in the output bin/tray.</td>
<td><tt><</OutputFaceUp true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>OutputType</tt></td>
<td>String</td>
<td>Specifies the output type name.</td>
<td><tt><</OutputType (Photo)>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>PageSize</tt></td>
<td>Integer/Real Array</td>
<td>Specifies the width and length/height of the page in points.</td>
<td><tt><</PageSize[595 842]>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>Separations</tt></td>
<td>Boolean</td>
<td>Specifies whether to produce color separations.</td>
<td><tt><</Separations true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>TraySwitch</tt></td>
<td>Boolean</td>
<td>Specifies whether to switch trays automatically.</td>
<td><tt><</TraySwitch true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>Tumble</tt></td>
<td>Boolean</td>
<td>Specifies whether the back sides of pages are rotated 180 degrees.</td>
<td><tt><</Tumble true>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsBorderlessScalingFactor</tt></td>
<td>Real</td>
<td>Specifies the amount to scale the page image dimensions.</td>
<td><tt><</cupsBorderlessScalingFactor 1.01>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsColorOrder</tt></td>
<td>Integer</td>
<td>Specifies the order of colors: 0 = chunked, 1 = banded, 2 = planar.</td>
<td><tt><</cupsColorOrder 0>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsColorSpace</tt></td>
<td>Integer</td>
<td>Specifies the page image colorspace: 0 = W, 1 = RGB, 2 = RGBA, 3 = K, 4 = CMY, 5 = YMC, 6 = CMYK, 7 = YMCK, 8 = KCMY, 9 = KCMYcm, 10 = GMCK, 11 = GMCS, 12 = White, 13 = Gold, 14 = Silver, 15 = CIE XYZ, 16 = CIE Lab, 17 = RGBW, 32 to 46 = CIE Lab (1 to 15 inks)</td>
<td><tt><</cupsColorSpace >>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsCompression</tt></td>
<td>Integer</td>
<td>Specifies a driver compression type/mode.</td>
<td><tt><</cupsCompression 2>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsInteger0<br>
...<br>
cupsInteger15</tt></td>
<td>Integer</td>
<td>Specifies driver integer values.</td>
<td><tt><</cupsInteger11 1234>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsMarkerType</tt></td>
<td>String</td>
<td>Specifies the type of ink/toner to use.</td>
<td><tt><</cupsMarkerType (Black+Color)>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsMediaType</tt></td>
<td>Integer</td>
<td>Specifies a numeric media type.</td>
<td><tt><</cupsMediaType 999>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsPageSizeName</tt></td>
<td>String</td>
<td>Specifies the name of the page size.</td>
<td><tt><</cupsPageSizeName (A4.Full)>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsPreferredBitsPerColor</tt></td>
<td>Integer</td>
<td>Specifies the preferred number of bits per color, typically 8 or 16.</td>
<td><tt><</cupsPreferredBitsPerColor 16>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsReal0<br>
...<br>
cupsReal15</tt></td>
<td>Real</td>
<td>Specifies driver real number values.</td>
<td><tt><</cupsReal15 1.234>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsRenderingIntent</tt></td>
<td>String</td>
<td>Specifies the color rendering intent.</td>
<td><tt><</cupsRenderingIntent (AbsoluteColorimetric)>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsRowCount</tt></td>
<td>Integer</td>
<td>Specifies the number of rows of raster data to print on each line for some drivers.</td>
<td><tt><</cupsRowCount 24>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsRowFeed</tt></td>
<td>Integer</td>
<td>Specifies the number of rows to feed between passes for some drivers.</td>
<td><tt><</cupsRowFeed 17>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsRowStep</tt></td>
<td>Integer</td>
<td>Specifies the number of lines between columns/rows on the print head for some drivers.</td>
<td><tt><</cupsRowStep 2>>setpagedevice</tt></td>
</tr>
<tr valign='top'>
<td><tt>cupsString0<br>
...<br>
cupsString15</tt></td>
<td>String</td>
<td>Specifies driver string values.</td>
<td><tt><</cupsString0(String Value)>>setpagedevice</tt></td>
</tr>
</tbody>
</table></div>
<h2 class='title'><a name='HISTORY'>Change History</a></h2>
<h3>Changes in CUPS 1.2.8</h3>
<ul>
<li>Added section on supported PostScript commands for raster
drivers</li>
</ul>
<h3>Changes in CUPS 1.2</h3>
<ul>
<li>Added globalization support attributes</li>
<li>Added custom option values support</li>
<li>Added <tt>APBookFile</tt> attribute</li>
<li>Added <tt>APDuplexRequiresFlippedMargin</tt> attribute</li>
<li>Added <tt>cupsICCProfile</tt> attribute</li>
<li>Added <tt>cupsIPPReason</tt> attribute</li>
<li>Added <tt>cupsLanguages</tt> attribute</li>
<li>Added <tt>cupsPortMonitor</tt> attribute</li>
<li>Removed <tt>cupsProtocol</tt> attribute</li>
</ul>
<h3>Changes in CUPS 1.1</h3>
<ul>
<li>Added <tt>cupsFlipDuplex</tt> attribute</li>
<li>Added <tt>cupsProtocol</tt> attribute</li>
</ul>
</body>
</html>