The CUPS PPD compiler reads meta files that contain descriptions
of one or more PPD files to be generated by
ppdc(1) or the corresponding driver interface
program drv(1). The source file format is plain
ASCII text that can be edited using your favorite text editor.
Directives may be placed anywhere on a line and are followed by
zero or more values.
Comments are supported using the C (/* ... */) and C++ (// ...) comment
mechanisms.
Directives that accept expressions look for sequences of the form:
NAME
Evaluates to 1 if NAME is defined, otherwise 0.
number
Evaluates to the specified integer; the number can be preceded by
a leading sign (+/-) followed by a decimal number (1234), octal number
(01234), or hexidecimal number (0x1234) using the same rules as C and
C++.
(NAME NAME ... number number ...)
Evaluates to the bitwise OR of each named #define constant or
number.
(NAME == OTHERNAME)
(NAME == number)
Evaluates to 1 if NAME is equal to the other named constant or
number, otherwise 0.
(NAME != OTHERNAME)
(NAME != number)
Evaluates to 1 if NAME is not equal to the other named constant or
number, otherwise 0.
(NAME < OTHERNAME)
(NAME < number)
Evaluates to 1 if NAME is less than to the other named constant or
number, otherwise 0.
(NAME <= OTHERNAME)
(NAME <= number)
Evaluates to 1 if NAME is less than or equal to the other named
constant or number, otherwise 0.
(NAME > OTHERNAME)
(NAME > number)
Evaluates to 1 if NAME is greater than to the other named constant
or number, otherwise 0.
(NAME >= OTHERNAME)
(NAME >= number)
Evaluates to 1 if NAME is greater than or equal to the other named
constant or number, otherwise 0.
Printer driver information can be grouped and shared using
curley braces ({ ... }); PPD files are written when a close
brace or end-of-file is seen and a PCFileName
directive has been defined.
The #define directive assigns a value to a name
which can be later referenced using $name. The name is
case-insensitive and can be any sequence of letters, numbers,
and the underscore. The value can be any valid expression.
Predefined Names
The following #define names are set by the PPD compiler:
CUPS_VERSION - The full CUPS version string, e.g.
"1.4.0"
CUPS_VERSION_MAJOR - The major version number, e.g.
"1"
CUPS_VERSION_MINOR - The minor version number, e.g.
"4"
CUPS_VERSION_PATCH - The patch version number, e.g.
"0"
PLATFORM_NAME - The operating system name used by the
current system as reported by "uname" ("Windows" on Microsoft
Windows)
PLATFORM_ARCH - The processor architecture used by the
current system as reported by "uname -m" ("X86" or "X64" on Microsoft
Windows)
The #elif directive allows portions of a driver information file
to be used conditionally. #elif directives must appear after a
corresponding #if directive.
The #else directive allows portions of a driver information file
to be used conditionally when the corresponding
#if and #elif
expressions are non-zero.
The #endif directive ends a conditional block of a driver
information file. It must appear after all of the
#if, #elif,
and #else directives for the current
conditional block.
#font Courier Standard "(1.05)" Standard ROM
#font Symbol Special "(001.005)" Special ROM
#font Barcode-Foo Special "(1.0)" Special Disk
#font Unicode-Foo Expert "(2.0)" Adobe-Identity ROM
Description
The #font directive defines a "base font" for all
printer drivers. The name is the PostScript font name.
The encoding is the default encoding of the font, usually
Standard, Expert, or Special, as
defined in the Adobe PPD file specification.
The version is the PostScript string definition that
corresponds to the font version number.
The charset defines the available characters in the font,
usually Standard or Special, as defined in the
Adobe PPD file specification.
The status is the installation status of the font and must be
either the word ROM or Disk.
Base fonts differ from fonts defined using the Font directive in that they are not
automatically associated with all drivers - you must use the
special Font * directive to include them in a
driver.
Currently the #font directive is used mainly for
defining the standard raster fonts in the
<font.defs> include file.
The #if directive allows portions of a driver information file
to be used conditionally. When followed by a name, the data that follows is
used only when the name is defined, otherwise the data is ignored.
#if directives can be nested up to 100 times.
The #include directive reads the named driver
information file. If the filename is included inside angle
brackets (<filename>), then the PPD compiler will
look for the file in all of the include directories it knows
about. Otherwise, the file is opened in the current directory
relative to the current driver information file, and if that
fails then it looks in the include directories for the file.
The #include directive can be nested to as many
files as are allowed by the host operating system, typically at
least 100 files.
The #media directive defines a named media size for
inclusion in a driver. The name with optional user text defines
the name for the media size and is used with the MediaSize directive to associate
the media size with the driver. The name may contain up to 40 ASCII
characters within the range of decimal 33 to decimal 126 inclusive,
except for the characters comma (44), slash (47) and colon (58).
The user text, if supplied, may not exceed 80 bytes in length.
The width and length define the dimensions of the media. Each
number is optionally followed by one of the following unit
suffixes:
The #po directive defines a message catalog to use for the
given POSIX language abbreviation. Multiple #po directives can be
specified to list multiple catalogs. The filename can be an absolute path or
relative to the driver information file. GNU gettext and Mac OS X .strings
files are supported.
The Attribute directive creates a PPD attribute. The
name may contain up to 40 ASCII characters within the range of decimal
33 to decimal 126 inclusive, except for the characters comma (44),
slash (47) and colon (58).
The selector can be the empty string ("") or text of up
to 80 bytes.
The value is any string or number; the string may contain multiple
lines, however no one line may exceed 255 bytes.
The Choice directive adds a single choice to the
current option. The name may contain up to 40 ASCII characters within
the range of decimal 33 to decimal 126 inclusive, except for the
characters comma (44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes
in length. If no text is provided, the name is used.
The code is any string and may contain multiple lines,
however no one line may exceed 255 bytes.
The ColorDevice directive tells the application if
the printer supports color. It is typically used in conjunction
with the ColorModel directive
to provide color printing support.
The ColorModel directive is a convenience directive
which creates a ColorModel option and choice for the current
printer driver. The name may contain up to 40 ASCII characters within
the range of decimal 33 to decimal 126 inclusive, except for the
characters comma (44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The colorspace argument is one of the standard colorspace
keywords defined later in this appendix in the section titled,
"Colorspace Keywords".
The colororder argument is one of the standard color order
keywords defined later in this appendix in the section titled,
"Color Order Keywords".
The compression argument is any number and is assigned to the
cupsCompression attribute in the PostScript page device
dictionary.
The ColorProfile directive defines a CMY
transform-based color profile. The resolution and mediatype
arguments specify the Resolution and MediaType
choices which use the profile; the hyphen (-) is used to
specify that any resolution or mediatype can be used with the
profile.
The gamma argument specifies the gamma correction to apply to
the color values (P = pg) and is a real number
greater than 0. Values larger than 1 cause a general lightening
of the print while values smaller than 1 cause a general
darkening of the print. A value of 1 disables gamma
correction.
The density argument specifies the linear density correction
to apply to the color values (P = d * pg) and is a
real number greater than 0 and less than or equal to 1. A value
1 of disables density correction while lower values produce
proportionately lighter output.
The matrix argument specifies a 3x3 linear transformation
matrix in row-major order. The matrix is applied only to the CMY
component of a RGB to CMYK transformation and is not used when
printing in grayscale or CMYK mode unless the printer only
supports printing with 3 colors.
Copyright "Copyright 2008 by Foo Enterprises"
Copyright
"This software is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111 USA"
Description
The Copyright directive adds text comments to the
top of a PPD file, typically for use in copyright notices. The
text argument can contain multiple lines of text, but no line
may exceed 255 bytes.
CustomMedia name width length left bottom right top
"size-code" "region-code"
CustomMedia "name/text" width length left bottom right top
"size-code" "region-code"
The CustomMedia directive adds a custom media size to
the driver. The name may contain up to 40 ASCII characters within the
range of decimal 33 to decimal 126 inclusive, except for the characters
comma (44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The width and length arguments specify the dimensions of the
media as defined for the #media
directive.
The left, bottom, right, and top arguments specify the
printable margins of the media.
The size-code and region-code arguments specify the
PostScript commands to run for the PageSize and
PageRegion options, respectively. The commands can
contain multiple lines, however no line may be more than 255
bytes in length.
The Cutter directive specifies whether the printer
has a built-in media cutter. When a cutter is present, the
printer's PPD file will contain a CutMedia option that
allows the user to control whether the media is cut at the end
of the job.
Darkness temperature name
Darkness temperature "name/text"
Examples
Darkness 0 Light
Darkness 2 "Normal/Standard"
Description
The Darkness directive defines a choice for the
cupsDarkness option which sets the
cupsCompression attribute in the PostScript page device
dictionary. It is used with the CUPS rastertolabel
sample driver to control the print head temperature and
therefore the darkness of the print.
The temperature argument specifies a temperature value for
the Dymo driver from 0 (lowest) to 3 (highest), with 2
representing the normal setting.
The name may contain up to 40 ASCII characters within the range of
decimal 33 to decimal 126 inclusive, except for the characters comma
(44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
Duplex none
Duplex normal
Duplex flip
Duplex rotated
Duplex manualtumble
Description
The Duplex directive determines whether double-sided printing
is supported in the current driver. The type argument specifies the type
of duplexing that is supported:
none - double-sided printing is not
supported
normal - double-sided printing is
supported
flip - double-sided printing is supported,
but the back side image needs to be flipped vertically
(used primarily with inkjet printers)
rotated - double-sided printing is supported,
but the back side image needs to be rotated 180 degrees for
DuplexNoTumble
manualtumble - double-sided printing is supported,
but the back side image needs to be rotated 180 degrees for
DuplexTumble
The Filter directive adds a filter for the current
driver. The mime-type argument is a valid MIME media type name
as defined in a CUPS mime.types file.
The cost argument specifies the relative cost of the filter.
In general, use a number representing the average percentage of
CPU time that is used when printing the specified MIME media
type.
The program argument specifies the program to run; if the
program is not an absolute filename, then CUPS will look for the
program in the CUPS filter directory.
The Finishing directive adds a choice to the
cupsFinishing option. The name may contain up to 40 ASCII
characters within the range of decimal 33 to decimal 126 inclusive,
except for the characters comma (44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The name is stored in the OutputType attribute in the
PostScript page device dictionary.
Font name encoding "version" charset status
Font *
Examples
Font *
Font Courier Standard "(1.05)" Standard ROM
Font Symbol Special "(001.005)" Special ROM
Font Barcode-Foo Special "(1.0)" Special Disk
Font Unicode-Foo Expert "(2.0)" Adobe-Identity ROM
Description
The Font directive defines a "device font" for the
current printer driver. The name is the PostScript font name.
The encoding is the default encoding of the font, usually
Standard, Expert, or Special, as
defined in the Adobe PPD file specification.
The version is the PostScript string definition that
corresponds to the font version number.
The charset defines the available characters in the font,
usually Standard or Special, as defined in the
Adobe PPD file specification.
The status is the installation status of the font and must be
either the word ROM or Disk.
Device fonts differ from fonts defined using the #font directive in that they are
automatically associated with the current driver. Fonts defined
using #font may be imported into the current driver
using the Font * form of this directive.
Group General
Group "InstallableOptions/Options Installed"
Group "Special/Vendor Options"
Description
The Group directive specifies the group for new
Option directives. The name may contain up to 40 ASCII
characters within the range of decimal 33 to decimal 126 inclusive,
except for the characters comma (44), slash (47) and colon (58).
If provided, the text can be any string up to 40 bytes in length.
If no text is provided, the name is used.
The names General and InstallableOptions
are predefined for the standard Adobe UI keywords and for installable
options, respectively.
Note:
Because of certain API binary compatibility issues,
CUPS limits the length of PPD group translation strings
(text) to 40 bytes, while the PPD specification
allows for up to 80 bytes.
The HWMargins directive specifies the current
margins for MediaSize that
follow. The left, bottom, right, and top margin values specify
the printable margins.
InputSlot position name
InputSlot position "name/text"
Examples
InputSlot 0 Auto
InputSlot 1 "Upper/Tray 1"
Description
The InputSlot directive adds a new choice to the
InputSlot option. The position argument is a number
from 0 to 232-1 specifying the value that is placed
in the MediaPosition attribute in the PostScript page
device dictionary.
The name may contain up to 40 ASCII characters within the range of
decimal 33 to decimal 126 inclusive, except for the characters comma
(44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The Installable directive adds a new boolean option
to the InstallableOptions group with a default value of
False. The name may contain up to 40 ASCII characters
within the range of decimal 33 to decimal 126 inclusive, except for
the characters comma (44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The LocAttribute directive creates a localized PPD
attribute. The name may contain up to 40 ASCII characters within the
range of decimal 33 to decimal 126 inclusive, except for the characters
comma (44), slash (47) and colon (58).
The selector can be the empty string ("") or text of up
to 80 bytes.
The value is any string or number; the string may contain multiple
lines, however no one line may exceed 255 bytes.
The Manufacturer directive specifies the
manufacturer name for the current driver. The name argument must
conform to the manufacturer name requirements in the Adobe PPD
file specification.
The MediaSize directive adds the named size to the
current printer driver using the current margins defined with
the HWMargins directive. The
name argument must match a media size defined using the #media directive.
The MediaType directive adds a new choice to the
MediaType option. The type argument is a number
from 0 to 232-1 specifying the value that is placed
in the cupsMediaType attribute in the PostScript page
device dictionary.
The name may contain up to 40 ASCII characters within the range of
decimal 33 to decimal 126 inclusive, except for the characters comma
(44), slash (47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The name is placed in the MediaType attribute in the
PostScript page device dictionary.
The ModelName directive sets the printer name for
the ModelName, NickName, and
ShortNickName attributes for the printer driver. The
name is any string of letters, numbers, spaces, and the
characters ".", "/", "-", and "+" and should not begin with the
manufacturer name since the PPD compiler will add this
automatically for you. The maximum length of the name string is
31 bytes to conform to the Adobe limits on the length of
ShortNickName.
The ModelNumber directive sets the
cupsModelNumber attribute for the printer driver, which
is often used by the printer driver filter to tailor its output
for the current device. The number is any integer or bitwise OR
of integers and constants that is appropriate for the printer
driver filters.
A complete list of printer driver model number constants is
available later in this appendix in the section titled, "Printer Driver ModelNumber
Constants".
The Option directive creates a new option in the
current group, by default the General group. The name
may contain up to 40 ASCII characters within the range of decimal 33
to decimal 126 inclusive, except for the characters comma (44), slash
(47) and colon (58).
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The type argument is one of the following keywords:
Boolean - a true/false option
PickOne - allows the user to pick one
choice from a list
PickMany - allows the user to pick zero or
more choices from a list
The section argument is one of the following keywords:
AnySetup - The option can be placed in
either the DocumentSetup or PageSetup sections of the
PostScript document
DocumentSetup - The option must be placed
in the DocumentSetup section of the PostScript document;
this does not allow the option to be overridden on
individual pages
ExitServer - The option must be placed in a
separate initialization job prior to the document (not
used for raster printer drivers)
JCLSetup - The option contains job control
language commands and must be sent prior to the document
using the JCLBegin and
JCLToPSInterpreter attributes (not used for
raster printer drivers)
PageSetup - The option must be placed at the
beginning of each page in the PostScript document
Prolog - The option must be placed in the
prolog section of the PostScript document; this is
typically used to add special comments for high-end
typesetters, but can also be used to add CUPS PostScript
job ticket comments.
The order argument is a real number greater than or equal to
0.0 and is used to sort the printer commands from many options
before sending them to the printer or RIP filter.
The PCFileName attribute specifies the name of the
PPD file for the current driver. The filename argument must
conform to the Adobe PPD file specification and can be no more
than 8 filename characters plus the extension ".ppd".
The Resolution directive creates a new
Resolution option choice which sets the
HWResolution, cupsBitsPerColor,
cupsRowCount, cupsRowFeed,
cupsRowStep, and optionally the cupsColorSpace
page device dictionary attributes. The colorspace argument
specifies a colorspace to use for the specified resolution and
can be the hyphen (-) character to make no change to
the selected color model or any keyword listed in the section
titled, "Colorspace Keywords", to
force the named colorspace.
The bits-per-color argument specifies the number of bits per
color to generate when RIP'ing a job. The values 1, 2, 4, and 8
are currently supported by CUPS.
The row-count, row-feed, and row-step argument specify the
driver-dependent values for the cupsRowCount,
cupsRowFeed, and cupsRowStep attributes,
respectively. Most drivers leave these attributes set to 0, but
any number from 0 to 232-1 is allowed.
The name argument must conform to the resolution naming
conventions in the Adobe PPD file specification, either
HHHdpi for symmetric resolutions or HHHxVVVdpi
for asymmetric resolutions. The HHH and VVV in
the examples represent the horizontal and vertical resolutions
which must be positive integer values.
If provided, the text can be any string up to 80 bytes in length.
If no text is provided, the name is used.
The SimpleColorProfile directive creates a
matrix-based ColorProfile
using values chosen with the cupsprofile(1) utility.
The resolution and mediatype arguments specify the
Resolution and MediaType choices which use the
profile; the hyphen (-) is used to specify that any
resolution or mediatype can be used with the profile.
The density argument specifies the linear density correction
to apply to the color values (P = d * 0.01 * pg) and
is an integer greater than 0 and less than or equal to 100. A
value 100 of disables density correction while lower values
produce proportionately lighter output. The density value
adjusts all color channels equally in all color modes.
The yellow-density argument specifies the density of the
yellow channel when printing in grayscale or RGB mode and is an
integer greater than 0 and less then or equal to 100. A value of
100 disables yellow density correction while lower values
produce proportionately lighter output.
The red-density argument specifies the two-color density
limit (e.g. C + M, C + Y, M + Y) when printing in grayscale or
RGB mode and is an integer greater than 0 and less then or equal
to 200. A value of 200 disables two-color density correction
while lower values produce proportionately lighter output.
The gamma argument specifies the gamma correction to apply to
the color values (P = pg) and is a real number
greater than 0. Values larger than 1 cause a general lightening
of the print while values smaller than 1 cause a general
darkening of the print. A value of 1 disables gamma
correction.
The red-adjust, green-adjust, blue-adjust arguments specify
the percentage of color to add or remove. Positive red-adjust
values add magenta and negative values add yellow. Positive
green-adjust values add cyan and negative values add yellow.
Positive blue-adjust values add cyan and negative values add
magenta. Values of 0 disable color adjustments.
The Througput directive sets the Troughput
attribute for the current printer driver. The pages-per-minute
argument is a positive integer representing the peak number of
pages per minute that the printer is capable of producing. Use a
value of 1 for printers that produce less than 1 page per
minute.
The UIConstraints directive adds a constraint
between two options. Constraints inform the application when a
user has chosen incompatible options. Each option name is
preceded by the asterisk (*). If no choice is given for
an option, then all choices exceptFalse and
None will conflict with the other option and choice(s).
Since the PPD compiler automatically adds reciprocal constraints
(option A conflicts with option B, so therefore option B
conflicts with option A), you need only specify the constraint
once.
The VariablePaperSize directive specifies whether
the current printer supports variable (custom) page sizes. When
yes is specified, the PPD compiler will include the
standard PPD attributes required to support custom page
sizes.
The Version directive sets the FileVersion
attribute in the PPD file and is also used for the
NickName attribute. The number argument is a positive
real number.
The CUPS DDK and sample drivers use the
cupsModelNumber attribute in the PPD file to tailor
their output to the printer. The following sections describe the
constants for each driver.
The epson driver supports Epson and Okidata
dot-matrix, Epson Stylus Color, and Epson Stylus Photo printers.
Table B-2 lists the constants for the ModelNumber directive.
ModelNumber values should be inserted by referencing
only one of these constants.
The hp driver supports HP LaserJet and DeskJet
printers. Table B-3 lists the constants
for the ModelNumber
directive. ModelNumber values should be inserted by
referencing only one of these constants.
The label driver supports the Dymo Labelwriter, Zebra CPCL, Zebra EPL, and Zebra ZPL, and Intellitech PCL label printers. Table B-4
lists the constants for the ModelNumber directive.
ModelNumber values should be inserted by referencing
only one of these constants.
The escp driver supports all Epson inkjet printers.
Table B-6 lists the constants for the ModelNumber directive.
ModelNumber values should be specified as the bitwise
OR of one or more of these constants.
The pcl driver supports all HP LaserJet, DeskJet,
and DesignJet printers. Table B-5 lists
the constants for the ModelNumber directive.
ModelNumber values should be specified as the bitwise
OR of one or more of these constants.