X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=doc%2Fhelp%2Fspec-ppd.html;h=3782eb7cab083b922a5c9ac887b4b776287c21bd;hb=5da48e461472590caea416fda443c3c8be3373c4;hp=d6f8f0879e70bb9a4cb3fe5a3b2bae3bf8aaa4c2;hpb=f7faf1f5c3235dfa4f883522da7dc6446f028247;p=thirdparty%2Fcups.git diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html index d6f8f0879..3782eb7ca 100644 --- a/doc/help/spec-ppd.html +++ b/doc/help/spec-ppd.html @@ -1,60 +1,568 @@ - + - - CUPS PPD Extensions - - - - + + CUPS PPD Extensions + + + + + + + + + -

Introduction

- -

This specification describes the attributes and extensions -that CUPS adds to -Adobe TechNote #5003: PostScript Printer Description File Format -Specification Version 4.3. PostScript Printer Description -("PPD") files describe the capabilities of each printer and are -used by CUPS to support printer-specific features and intelligent -filtering.

- +

CUPS PPD Extensions

+ +

This specification describes the attributes and extensions that CUPS adds to Adobe TechNote #5003: PostScript Printer Description File Format Specification Version 4.3. PostScript Printer Description ("PPD") files describe the capabilities of each printer and are used by CUPS to support printer-specific features and intelligent filtering.

+ +
+ + + + + + +
See AlsoProgramming: Developing PostScript Printer Drivers
+ Programming: Developing Raster Printer Drivers
+ Programming: Filter and Backend Programming
+ Programming: Introduction to the PPD Compiler
+ Programming: Raster API
+ References: PPD Compiler Driver Information File Reference
+
+

Contents

+ +
+

PPD File Syntax

-

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:

+

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 [RFC5234] defines the general format of lines in a PPD file:

 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
+HEADER   = "*PPD-Adobe:" *WSP DQUOTE VERSION DQUOTE LINE-END
+
+VERSION  = "4.0" / "4.1" / "4.2" / "4.3"
 
 COMMENT  = "*%" *TCHAR LINE-END
 
@@ -65,437 +573,332 @@ VALUE    = 1*TCHAR / DQUOTE 1*SCHAR DQUOTE
 
 KCHAR    = ALPHA / DIGIT / "_" / "." / "-"
 
-SCHAR    = LINE-END / WSP / %x21 / %x23-7E / %xA0-FF
+SCHAR    = LINE-END / WSP / %x21.23-7E.A0-FF
 
-TCHAR    = %x20-7E / %xA0-FF
+TCHAR    = %x20-7E.A0-FF
 
 LINE-END = CR / LF / CR LF
 
-

General Attributes

- -

APBookFile

- -

*APBookFile: "file URL"

- -

This string attribute specifies the Apple help book file to use -for this printer driver.

- -

Example:

- -
-*APBookFile: "file:///Library/Printers/vendor/Help/filename"
-
- -

APDuplexRequiresFlippedMargin

- -

*APDuplexRequiresFlippedMargin: boolean

- -

This boolean attribute notifies the RIP filters that the -destination printer does not require the top and bottom margins -of the ImageableArea swapped for the back page. The -default value is true.

+

Auto-Configuration

-

Example:

+

CUPS supports several methods of auto-configuration via PPD keywords.

-
-*% Don't swap the top and bottom margins for the back side 
-*APDuplexRequiresFlippedMargin: false
-
-

Also see the related cupsFlipDuplex attribute.

+

macOS 10.5APAutoSetupTool

-

cupsFilter

+

*APAutoSetupTool: "/LibraryPrinters/vendor/filename"

-

*cupsFilter: "source/type cost program"

+

This macOS keyword defines a program that sets the default option choices. It is run when a printer is added from the Add Printer window or the Nearby Printers list in the Print dialog.

-

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.

+

The program is provided with two arguments: the printer's device URI and the PPD file to be used for the printer. The program must write an updated PPD file to stdout.

Examples:

-*% Standard raster printer driver filter 
-*cupsFilter: "application/vnd.cups-raster 100 rastertofoo"
+*% Use our setup tool when adding a printer
+*APAutoSetupTool: "/Library/Printers/vendor/Tools/autosetuptool"
+
-*% Plain text filter -*cupsFilter: "text/plain 10 texttofoo" -*% Pass-through filter for PostScript printers -*cupsFilter: "application/vnd.cups-postscript 0 -" - +

macOS 10.2/CUPS 1.4?MainKeyword

-

cupsFlipDuplex

+

*?MainKeyword: "
+ PostScript query code that writes a message using the = operator...
+"
+*End

-

*cupsFlipDuplex: boolean

+

The ?MainKeyword keyword defines PostScript code that determines the currently selected/enabled option keyword (choice) for the main keyword (option). It is typically used when communicating with USB, serial, Appletalk, and AppSocket (port 9100) printers.

-

This boolean attribute notifies the RIP filters that the -destination printer requires an upside-down image for the back -page. The default value is false.

+

The PostScript code typically sends its response back using the = operator.

Example:

-*% Flip the page image for the back side of duplexed output 
-*cupsFlipDuplex: true
+*OpenUI OptionDuplex/Duplexer Installed: Boolean
+*DuplexOptionDuplex: False
+*OptionDuplex False/Not Installed: ""
+*OptionDuplex True/Installed: ""
+
+*% Query the printer for the presence of the duplexer option...
+*?OptionDuplex: "
+  currentpagedevice /Duplex known
+  {(True)} {(False)} ifelse
+  = flush
+"
+*End
+*CloseUI: OptionDuplex
 
-

Also see the related APDuplexRequiresFlippedMargins attribute.

-

cupsIPPReason

+

macOS 10.4/CUPS 1.5OIDMainKeyword

-

*cupsIPPReason reason/Reason Text: "optional URIs"

+

*?OIDMainKeyword: ".n.n.n..."
+*OIDMainKeyword OptionKeyword1: "value"
+...
+*OIDMainKeyword OptionKeywordN: "value"

-

This optional attribute maps custom -printer-state-reasons 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 DocumentRoot 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.

+

The OIDMainKeyword keyword is used to define SNMP OIDs that map to installable options. The first (query) line defines the OID to lookup on the network device. The second and subsequent keywords define a mapping from OID value to option keyword. Since SNMP is an IP-based network protocol, this method is typically only used to configure AppSocket, IPP, and LPD network printers.

Examples:

-*% Map com.vendor-error to text but no page
-*cupsIPPReason com.vendor-error/A serious error occurred: ""
+*% Get the installed memory on the printer...
+*?OIDInstalledMemory: ".1.3.6.1.2.1.25.2.2.0"
+*OIDInstalledMemory 16MB: "16384 KBytes"
+*OIDInstalledMemory 32MB: "32768 KBytes"
+*OIDInstalledMemory 48MB: "49152 KBytes"
+*OIDInstalledMemory 72MB: "73728 KBytes"
+
-*% Map com.vendor-error to text and a local page -*cupsIPPReason com.vendor-error/A serious error occurred: "/help/com.vendor/error.html" -*% Map com.vendor-error to text and a remote page -*cupsIPPReason com.vendor-error/A serious error occurred: "http://www.vendor.com/help" +

Color Profiles

-*% Map com.vendor-error to text and a local, Apple help book, and remote page -*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 - +

CUPS supports three types of color profiles. The first type is based on sRGB and is used by the standard CUPS raster filters and GPL Ghostscript. The second type is based on ICC profiles and is used by the Quartz-based filters on macOS. The final type is based on well-known colorspaces such as sRGB and Adobe RGB.

-

cupsLanguages

+
Note: -

*cupsLanguages: "locale list"

+

At this time, none of the CUPS raster filters support ICC profiles. This will be addressed as time and resources permit.

-

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.)

+
-

Example:

-
-*% Specify Canadian, UK, and US English, and Candian and French French 
-*cupsLanguages: "en_CA en_UK en_US fr_CA fr_FR"
-
+

DeprecatedcupsColorProfile

-

cupsManualCopies

+

*cupsColorProfile Resolution/MediaType: "density gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"

-

*cupsManualCopies: boolean

+

This string keyword specifies an sRGB-based color profile consisting of gamma and density controls and a 3x3 CMY color transform matrix. This keyword is not supported on macOS.

-

This boolean attribute notifies the RIP filters that the -destination printer does not support copy generation in -hardware. The default value is false.

+

The Resolution and MediaType values may be "-" to act as a wildcard. Otherwise they must match one of the Resolution or MediaType option keywords defined in the PPD file.

-

Example:

+

The density and gamma values define gamma and +density adjustment function such that:

-*% Tell the RIP filters to generate the copies for us 
-*cupsManualCopies: true
+f(x) = density * x gamma
 
-

cupsModelNumber

- -

*cupsModelNumber: number

+

The m00 through m22 values define a 3x3 transformation matrix for the CMY color values. The density function is applied after the CMY transformation:

-

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.

+
+| m00 m01 m02 |
+| m10 m11 m12 |
+| m20 m21 m22 |
+
-

Example:

+

Examples:

-*% Specify an integer for a driver-specific model number 
-*cupsModelNumber: 1234
+*% Specify a profile for printing at 360dpi on all media types
+*cupsColorProfile 360dpi/-: "1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
+
+*% Specify a profile for printing at 720dpi on Glossy media
+*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"
+
+*% Specify a default profile for printing at all other resolutions and media types
+*cupsColorProfile -/-: "0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
 
-

cupsPortMonitor

-

*cupsPortMonitor urischeme/Descriptive Text: "port monitor"

+

macOS 10.3/CUPS 1.2cupsICCProfile

-

This string attribute specifies printer-specific "port -monitor" filters that may be used with the printer. The CUPS -scheduler also looks for the Protocols attribute to see -if the BCP or TBCP protocols are supported. If -so, the corresponding port monitor ("bcp" and "tbcp", -respectively) is listed in the printer's -port-monitor-supported attribute.

+

*cupsICCProfile ColorModel.MediaType.Resolution/Description: "filename"

-

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.

+

This keyword specifies an ICC color profile that is used to convert the document colors to the device colorspace. The ColorModel, MediaType, and Resolution option keywords specify a selector for color profiles. If omitted, the color profile will match any option keyword for the corresponding main keyword.

+ +

The Description specifies human-readable text that is associated with the color profile. The filename portion specifies the ICC color profile to use; if the filename is not absolute, it is loaded relative to the /usr/share/cups/profiles directory.

Examples:

-*% Specify a PostScript printer that supports the TBCP protocol
-*Protocols: TBCP PJL
+*% Specify a profile for CMYK printing at 360dpi on all media types
+*cupsICCProfile CMYK..360dpi/360dpi CMYK: "/Library/Printers/vendor/Profiles/foo-360-cmyk.icc"
 
-*% Specify that TBCP should be used for socket connections but not USB
-*cupsPortMonitor socket/AppSocket Printing: "tbcp"
-*cupsPortMonitor usb/USB Printing: "none"
+*% Specify a profile for RGB printing at 720dpi on Glossy media
+*cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "/Library/Printers/vendor/Profiles/foo-720-glossy-rgb.icc"
 
-*% Specify a printer-specific port monitor for an Epson USB printer 
-*cupsPortMonitor usb/USB Status Monitor: "epson-usb"
+*% Specify a default profile for printing at all other resolutions and media types
+*cupsICCProfile ../Default: "/Library/Printers/vendor/Profiles/foo-default.icc"
 
-

cupsVersion

- -

*cupsVersion: major.minor

- -

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".

+

Customizing the Profile Selection Keywords

-

Example:

+

The ColorModel, MediaType, and Resolution main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The cupsICCQualifier1, cupsICCQualifier2, and cupsICCQualifier3 keywords define the mapping from selector to main keyword:

-*% Specify a CUPS 1.2 driver 
-*cupsVersion: "1.2"
+*cupsICCQualifier1: MainKeyword1
+*cupsICCQualifier2: MainKeyword2
+*cupsICCQualifier3: MainKeyword3
 
-

Custom Options

- -

CUPS supports custom options using an extension of the -CustomPageSize and ParamCustomPageSize -syntax:

+

The default mapping is as follows:

-*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
+*cupsICCQualifier1: ColorModel
+*cupsICCQualifier2: MediaType
+*cupsICCQualifier3: Resolution
 
-

When the base option is part of the JCLSetup 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".

- -

For non-JCLSetup 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".

- -

The "type" is one of the following keywords:

- - +

This keyword defines an alternate name for the color matching provided by a driver in the Color Matching print panel. The default is to use the name "Vendor Matching" or its localized equivalent.

Examples:

-*% Base JCL key code option 
-*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
+*% Define the names for our color matching...
+*APCustomColorMatchingName name/AcmeColor(tm): ""
+*fr.APCustomColorMatchingName name/La AcmeColor(tm): ""
+
-*% Custom JCL key code option -*CustomJCLPasscode True: "@PJL SET PASSCODE = \1<0A>" -*ParamCustomJCLPasscode Code/Key Code: 1 passcode 4 4 +

macOS 10.5APCustomColorMatchingProfile

+

*APCustomColorMatchingProfile: name

-*% Base PostScript watermark option -*OpenUI WatermarkText/Watermark Text: PickOne -*OrderDependency: 10 AnySetup *WatermarkText -*DefaultWatermarkText: None -*WatermarkText None: "" -*WatermarkText Draft: "<</cupsString1(Draft)>>setpagedevice" -*CloseUI: *WatermarkText +

This keyword defines a supported RGB color profile that can be used when doing custom color matching. Currently only sRGB, AdobeRGB, and GenericRGB are supported. If not specified, RGB data will use the GenericRGB colorspace.

-*% Custom PostScript watermark option -*CustomWatermarkText True: "<</cupsString1 2 1 roll>>setpagedevice" -*ParamCustomWatermarkText Text: 1 string 0 32 +
Note: +

If you provide multiple APCustomColorMatchingProfile keywords, you are responsible for providing the necessary user interface controls to select the profile in a print dialog pane. Add the named profile to the print settings using the key kPMCustomColorMatchingProfileKey.

-*% Base PostScript gamma/density option -*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 +
-*% Custom PostScript gamma/density option -*CustomGammaDensity True: "<</cupsReal1 3 1 roll/cupsReal2 3 1>>setpagedevice" -*ParamCustomGammaDensity Gamma: 1 curve 0.1 10 -*ParamCustomGammaDensity Density: 2 real 0 2 +

Examples:

+ +
+*% Use sRGB for RGB color by default, but support both sRGB and AdobeRGB
+*APSupportsCustomColorMatching: true
+*APDefaultCustomColorMatchingProfile: sRGB
+*APCustomColorMatchingProfile: sRGB
+*APCustomColorMatchingProfile: AdobeRGB
 
+

macOS 10.5APDefaultCustomColorMatchingProfile

-

Color Profiles

+

*APDefaultCustomColorMatchingProfile: name

-

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.

+

This keyword defines the default RGB color profile that will be used when doing custom color matching. Currently only sRGB, AdobeRGB, and GenericRGB are supported.

-
Note: At this time, none of the CUPS raster -filters support ICC profiles. This will be addressed as time -and resources permit.
+

Examples:

-

cupsColorProfile

+
+*% Use sRGB for RGB color by default
+*APSupportsCustomColorMatching: true
+*APDefaultCustomColorMatchingProfile: sRGB
+
-

*cupsColorProfile Resolution/MediaType: "density -gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"

+

macOS 10.4APSupportsCustomColorMatching

-

This string attribute specifies an sRGB-based color profile -consisting of gamma and density controls and a 3x3 CMY color -transform matrix.

+

*APSupportsCustomColorMatching: boolean

-

The Resolution and MediaType values may be "-" -to act as a wildcard. Otherwise they must match one of the -Resolution or MediaType attributes defined in -the PPD file.

+

This keyword specifies that the driver provides its own custom color matching. When true, the default hand-off colorspace will be GenericGray, GenericRGB, or GenericCMYK depending on the number of components the driver requests. The APDefaultCustomColorMatchingProfile keyword can be used to override the default 3-component (RGB) colorspace.

-

The density and gamma values define gamma and -density adjustment function such that:

+

The default for APSupportsCustomColorMatching is false.

+ +

Examples:

-f(x) = density * x gamma
+*APSupportsCustomColorMatching: true
+*APDefaultCustomColorMatchingProfile: sRGB
 
-

The m00 through m22 values define a 3x3 -transformation matrix for the CMY color values. The density -function is applied after the CMY transformation:

+ +

Constraints

+ +

Constraints are option choices that are not allowed by the driver or device, for example printing 2-sided transparencies. All versions of CUPS support constraints defined by the legacy Adobe UIConstraints and NonUIConstraints keywords which support conflicts between any two option choices, for example:

-| m00 m01 m02 |
-| m10 m11 m12 |
-| m20 m21 m22 |
+*% Do not allow 2-sided printing on transparency media
+*UIConstraints: "*Duplex *MediaType Transparency"
+*UIConstraints: "*MediaType Transparency *Duplex"
 
-

Examples:

+

While nearly all constraints can be expressed using these keywords, there are valid scenarios requiring constraints between more than two option choices. In addition, resolution of constraints is problematic since users and software have to guess how a particular constraint is best resolved.

-
-*% Specify a profile for printing at 360dpi on all media types 
-*cupsColorProfile 360dpi/-: "1.0 1.5 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0"
+

CUPS 1.4 and higher define two new keywords for constraints, cupsUIConstraints and cupsUIResolver. Each cupsUIConstraints keyword points to a cupsUIResolver keyword which specifies alternate options that resolve the conflict condition. The same cupsUIResolver can be used by multiple cupsUIConstraints.

-*% Specify a profile for printing at 720dpi on Glossy media -*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" +
Note: -*% Specify a default profile for printing at all other resolutions and media types -*cupsColorProfile -/-: "0.9 2.0 1.0 0.0 -0.2 -0.4 1.0 0.0 -0.2 0.0 1.0" -
+

When developing PPD files that contain constraints, it is very important to use the cupstestppd(1) program to verify that your constraints are accurate and cannot result in unresolvable option selections.

+ + -

cupsICCProfile

-

*cupsICCProfile -ColorModel.MediaType.Resolution/Description: "filename"

+

CUPS 1.4/macOS 10.6cupsUIConstraints

-

This attribute specifies an ICC color profile that is -used to convert the document colors to the device -colorspace. The ColorModel, MediaType, and -Resolution keywords specify a selector for color -profiles. If omitted, the color profile will match any option -keyword for the corresponding main keyword.

+

*cupsUIConstraints resolver: "*Keyword1 *Keyword2 ..."
+*cupsUIConstraints resolver: "*Keyword1 OptionKeyword1 *Keyword2 ..."
+*cupsUIConstraints resolver: "*Keyword1 *Keyword2 OptionKeyword2 ..."
+*cupsUIConstraints resolver: "*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."
+*cupsUIConstraints: "*InstallableKeyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."

-

The Description specifies human-readable text that -is associated with the color profile. The filename -portion specifies the ICC color profile to use; if the filename -is not absolute, it is loaded relative to the -/usr/share/cups/profiles directory.

+

Lists two or more options which conflict. The "resolver" string is a (possibly unique) keyword which specifies which options to change when the constraint exists. When no resolver is provided, CUPS first tries the default choice followed by testing each option choice to resolve the conflict.

Examples:

-*% Specify a profile for CMYK printing at 360dpi on all media types 
-*cupsICCProfile CMYK..360dpi/360dpi CMYK: "vendor/foo-360-cmyk.icc"
+*% Specify that 2-sided printing cannot happen on transparencies
+*cupsUIConstraints transparency: "*Duplex *MediaType Transparency"
 
-*% Specify a profile for RGB printing at 720dpi on Glossy media 
-*cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "vendor/foo-720-glossy-rgb.icc"
+*% Specify that envelope printing cannot happen from the paper trays
+*cupsUIConstraints envelope: "*PageSize Env10 *InputSlot Tray1"
+*cupsUIConstraints envelope: "*PageSize Env10 *InputSlot Tray1"
+*cupsUIConstraints envelope: "*PageSize EnvDL *InputSlot Tray2"
+*cupsUIConstraints envelope: "*PageSize EnvDL *InputSlot Tray2"
 
-*% Specify a default profile for printing at all other resolutions and media types 
-*cupsICCProfile ../Default: "vendor/foo-default.icc"
+*% Specify an installable option constraint for the envelope feeder
+*cupsUIConstraints: "*InputSlot EnvFeeder *InstalledEnvFeeder"
+
+*% Specify that photo printing cannot happen on plain paper or transparencies at 1200dpi
+*cupsUIConstraints photo: "*OutputMode Photo *MediaType Plain *Resolution 1200dpi"
+*cupsUIConstraints photo: "*OutputMode Photo *MediaType Transparency *Resolution 1200dpi"
 
-

Customizing the Profile Selection Keywords

-

The MediaType and Resolution keywords can be -reassigned to different main keywords, allowing drivers to do -color profile selection based on different parameters. The -cupsICCQualifier2 and cupsICCQualifier3 -attributes define the mapping from selector to main keyword:

+

CUPS 1.4/macOS 10.6cupsUIResolver

-
-*cupsICCQualifier2: MainKeyword2
-*cupsICCQualifier3: MainKeyword3
-
+

*cupsUIResolver resolver: "*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ..."

-

The default mapping is as follows:

+

Specifies two or more options to mark/select to resolve a constraint. The "resolver" string identifies a particular action to take for one or more cupsUIConstraints. The same action can be used for multiple constraints. The option keyword pairs are treated as an ordered list of option selections to try - only the first N selections will be used, where N is the minimum number of selections required. Because cupsResolveConflicts() will not change the most recent option selection passed to it, at least two options from the constraints must be listed to avoid situations where conflicts cannot be resolved.

+ +

Examples:

-*cupsICCQualifier2: MediaType
-*cupsICCQualifier3: Resolution
+*% Specify the options to change for the 2-sided transparency constraint
+*cupsUIResolver transparency: "*Duplex None *MediaType Plain"
+
+*% Specify the options to change for the envelope printing constraints.  Notice
+*% that we try to change the InputSlot to either the envelope feeder or the
+*% manual feed first, then we change the page size...
+*cupsUIResolver envelope: "*InputSlot EnvFeeder *InputSlot ManualFeed *PageSize Letter"
+
+*% Specify the options to change for the photo printing constraints
+*cupsUIResolver photo: "*OutputMode Best *Resolution 600dpi"
 

Globalized PPD Support

-

CUPS 1.2 and higher adds support for PPD files containing multiple -languages by following the following additional rules:

+

CUPS 1.2 and higher adds support for PPD files containing multiple languages by following the following additional rules:

    @@ -503,72 +906,55 @@ languages by following the following additional rules:

  1. The LanguageEncoding MUST be ISOLatin1
  2. -
  3. The cupsLanguages attribute MUST be provided and - list each of the supported locales in the PPD file
  4. +
  5. The cupsLanguages keyword MUST be provided and list each of the supported locales in the PPD file
  6. -
  7. Main and option keywords MUST NOT exceed 34 (instead of 40) - characters to allow room for the locale prefixes in translation - attributes
  8. +
  9. Main and option keywords MUST NOT exceed 34 (instead of 40) characters to allow room for the locale prefixes in translation keywords
  10. The main keyword "Translation" MUST NOT be used
  11. -
  12. 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.
  13. - -
  14. 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
  15. - -
  16. Locale-specific translation strings MUST be encoded - using UTF-8.
  17. - -
  18. Main keywords MUST be localized using one of the - following forms: -

    *ll.Translation MainKeyword/translation - text: ""
    - *ll_CC.Translation MainKeyword/translation - text: ""

  19. - -
  20. Option keywords MUST be localized using one of the - following forms: -

    *ll.MainKeyword OptionKeyword/translation - text: ""
    - *ll_CC.MainKeyword OptionKeyword/translation - text: ""

  21. - -
  22. Localization attributes MAY appear anywhere after the - first line of the PPD file
  23. +
  24. 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 keywords for the affected keywords.
  25. + +
  26. 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
      +
    • A generic language translation ("ll") SHOULD be provided with country-specific differences ("ll_CC") provided only as needed
    • +
    • For historical reasons, the "zh" and "zh_CN" locales map to Simplified Chinese while the "zh_TW" locale maps to Traditional Chinese
    • +
  27. + +
  28. Locale-specific translation strings MUST be encoded using UTF-8.
  29. + +
  30. Main keywords MUST be localized using one of the following forms: +

    *ll.Translation MainKeyword/translation text: ""
    + *ll_CC.Translation MainKeyword/translation text: ""

  31. + +
  32. Option keywords MUST be localized using one of the following forms: +

    *ll.MainKeyword OptionKeyword/translation text: ""
    + *ll_CC.MainKeyword OptionKeyword/translation text: ""

  33. + +
  34. Localization keywords MAY appear anywhere after the first line of the PPD file
Note: -We use a LanguageEncoding value of ISOLatin1 -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.
+ +

We use a LanguageEncoding value of ISOLatin1 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.

+ +

Examples:

 *LanguageVersion: English
 *LanguageEncoding: ISOLatin1
-*cupsLanguages: "de_DE fr_FR"
+*cupsLanguages: "de fr_CA"
 *ModelName: "Foobar Laser 9999"
 
 *% Localize ModelName for French and German
-*fr_FR.Translation ModelName/La Foobar Laser 9999: ""
-*de_DE.Translation ModelName/Foobar LaserDrucken 9999: ""
+*fr_CA.Translation ModelName/La Foobar Laser 9999: ""
+*de.Translation ModelName/Foobar LaserDrucken 9999: ""
 
 *cupsIPPReason com.vendor-error/A serious error occurred: "/help/com.vendor/error.html"
 *% Localize printer-state-reason for French and German
-*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"
+*fr_CA.cupsIPPReason com.vendor-error/Une erreur sèrieuse s'est produite: "/help/com.vendor/error.html"
+*de.cupsIPPReason com.vendor-error/Eine ernste Störung trat: "/help/com.vendor/error.html"
 
 ...
 
@@ -576,55 +962,1712 @@ in the PPD file for a given locale.
 *OrderDependency: 10 AnySetup *InputSlot
 *DefaultInputSlot: Auto
 *% Localize InputSlot for French and German
-*fr_FR.Translation InputSlot/Papier source: ""
-*de_DE.Translation InputSlot/Papiereinzug: ""
+*fr_CA.Translation InputSlot/Papier source: ""
+*de.Translation InputSlot/Papiereinzug: ""
 *InputSlot Auto/Default: "<</ManualFeed false>>setpagedevice"
 *% Localize InputSlot=Auto for French and German
-*fr_FR.InputSlot Auto/Par Defaut: ""
-*de_DE.InputSlot Auto/Standard: ""
+*fr_CA.InputSlot Auto/Par Defaut: ""
+*de.InputSlot Auto/Standard: ""
 *InputSlot Manual/Manual Feed: "<</ManualFeed true>>setpagedevice"
 *% Localize InputSlot=Manual for French and German
-*fr_FR.InputSlot Manual/Manuel mecanisme de alimentation: ""
-*de_DE.InputSlot Manual/Manueller Einzug: ""
+*fr_CA.InputSlot Manual/Manuel mecanisme de alimentation: ""
+*de.InputSlot Manual/Manueller Einzug: ""
 *CloseUI: *InputSlot
 
-

Change History

+

CUPS 1.3/macOS 10.6Custom Options

-

Changes in CUPS 1.2

+

CUPS supports custom options using an extension of the CustomPageSize and ParamCustomPageSize syntax:

-
+