Download here: http://gg.gg/vzh4b
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 ReferenceContents
*Auto-Configuration
*Color Profiles
*Constraints
*Media Keywords
*General Attributes
*macOS Attributes
Aug 19, 2012 Just yesterday, I installed Adobe’s ICC Profiles on my Ubuntu computer. If you look in the folder usr/share/color/icc, you will see the preinstalled color profiles that come with Ubuntu. These profiles control how color is displayed on your monitor, from the printer, etc. So, why would anyone need to install Adobe’s color profiles on their. @Scott understood. So what I’m trying to do is mimic the conversion that Illustrator (I guess the OS in this case) presents to the user, but programmatically on a linux server. How can I figure out what profiles the OS is doing for the conversion? – Alexander Rolek Jul 20 ’13 at 16:25.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 [RFC5234] defines the general format of lines in a PPD file:Auto-Configuration
CUPS supports several methods of auto-configuration via PPD keywords.macOS 10.5APAutoSetupTool
*APAutoSetupTool: ’/LibraryPrinters/vendor/filename’
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.
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:macOS 10.2/CUPS 1.4?MainKeyword
*?MainKeyword: ’ PostScript query code that writes a message using the = operator...’*End
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.
The PostScript code typically sends its response back using the = operator.
Example:macOS 10.4/CUPS 1.5OIDMainKeyword
*?OIDMainKeyword: ’.n.n.n...’*OIDMainKeywordOptionKeyword1: ’value’...*OIDMainKeywordOptionKeywordN: ’value’
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:Color Profiles
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.Note:
At this time, none of the CUPS raster filters support ICC profiles. This will be addressed as time and resources permit.DeprecatedcupsColorProfile
*cupsColorProfile Resolution/MediaType: ’density gamma m00 m01 m02 m10 m11 m12 m20 m21 m22’
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.
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.
The density and gamma values define gamma anddensity adjustment function such that:
The m00 through m22 values define a 3x3 transformation matrix for the CMY color values. The density function is applied after the CMY transformation:
Examples:macOS 10.3/CUPS 1.2cupsICCProfile
*cupsICCProfile ColorModel.MediaType.Resolution/Description: ’filename’
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:Customizing the Profile Selection Keywords
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:
The default mapping is as follows:macOS 10.4Custom Color Matching Support
*APSupportsCustomColorMatching: true*APCustomColorMatchingName name/text: ’*APCustomColorMatchingProfile: profile*APDefaultCustomColorMatchingProfile: profile
These keywords tell the macOS raster filters that the printer driver provides its own custom color matching and that generic color profiles should be used when generating 1-, 3-, and 4-component raster data as requested by the driver. The APCustomColorMatchingProfile and APDefaultColorMatchingProfile keywords specify alternate color profiles (sRGB or AdobeRGB) to use for 3-color (RGB) raster data.Note:
Prior to macOS 10.6, the default RGB color space was Apple’s ’GenericRGB’. The new default in macOS 10.6 and later is ’sRGB’. For more information, see ’macOS v10.6: About gamma 2.2’ on Apple’s support site.macOS 10.5APCustomColorMatchingName
*APCustomColorMatchingName name/text: ’
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:macOS 10.5APCustomColorMatchingProfile
*APCustomColorMatchingProfile: name
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.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.
Examples:macOS 10.5APDefaultCustomColorMatchingProfile
*APDefaultCustomColorMatchingProfile: name
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.
Examples:macOS 10.4APSupportsCustomColorMatching
*APSupportsCustomColorMatching: boolean
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 default for APSupportsCustomColorMatching is false.
Examples: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:
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.
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.Note:
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.CUPS 1.4/macOS 10.6cupsUIConstraints
*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 ...’
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:CUPS 1.4/macOS 10.6cupsUIResolver
*cupsUIResolver resolver: ’*Keyword1 OptionKeyword1 *Keyword2 OptionKeyword2 ...’
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:Globalized PPD Support
CUPS 1.2 and higher adds support for PPD files containing multiple languages by following the following additional rules:
*The LanguageVersion MUST be English
*The LanguageEncoding MUST be ISOLatin1
*The cupsLanguages keyword MUST be provided and list each of the supported locales in the PPD file
*Main and option keywords MUST NOT exceed 34 (instead of 40) characters to allow room for the locale prefixes in translation keywords
*The main keyword ’Translation’ MUST NOT be used
*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.
*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
*Locale-specific translation strings MUST be encoded using UTF-8.
*Main keywords MUST be localized using one of the following forms:
*ll.Translation MainKeyword/translation text: ’*ll_CC.Translation MainKeyword/translation text: ’
*Option keywords MUST be localized using one of the following forms:
*ll.MainKeyword OptionKeyword/translation text: ’*ll_CC.MainKeyword OptionKeyword/translation text: ’
*Localization keywords MAY appear anywhere after the first line of the PPD fileNote:
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:CUPS 1.3/macOS 10.6Custom Options
CUPS supports custom options using an extension of the CustomPageSize and ParamCustomPageSize syntax:Adobe Icc Profiles Linux Server 2020
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 firstoption 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:
*curve - a real value from ’minimum’ to ’maximum’ representing a gamma correction curve using the function: f(x) = x value
*int - an integer value from ’minimum’ to ’maximum’
*invcurve - a real value from ’minimum’ to ’maximum’ representing a gamma correction curve using the function: f(x) = x 1 / value
*passcode - 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)
*password - 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)
*points - a measurement value in points from ’minimum’ to ’maximum’
*real - a real value from ’minimum’ to ’maximum’
*string - a string value with a minimum of ’minimum’ characters and a maximum of ’maximum’ characters (’minimum’ and ’maximum’ are numbers)
Examples:Writing PostScript Option Commands for Raster Drivers
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 keywords such as page size, resolution, and so forth. For example, the following code sets the page size to A4 size:
Custom options typically use other operators to organize the values into a key/value dictionary for setpagedevice. For example, our previous CustomWatermarkText option code uses the roll operator to move the custom string value into the dictionary for setpagedevice:
For a custom string value of ’My Watermark’, CUPS will produce the following PostScript code for the option:
The code moves the string value (’My Watermark’) from the bottom of the stack to the top, creating a dictionary that looks like:
The resulting dictionary sets the page device attributes that are sent to your raster driver in the page header.Custom Page Size Code
There are many possible implementations of the CustomPageSize code. For CUPS raster drivers, the following code is recommended:Supported PostScript Operators
CUPS supports the following PostScript operators in addition to the usual PostScript number, string (literal and hex-encoded), boolean, null, and name values:
*<< - Start a dictionary.
*>> - End a dictionary.
*[ - Start an array.
*] - End an array.
*copy - Copy the top N objects on the stack.
*dup - Copy the top object on the stack.
*index - Copy the Nth from the top object on the stack.
*pop - Pop the top object on the stack.
*roll - Shift the top N objects on the stack.
*setpagedevice - Set the page header values according to the key/value dictionary on the stack.Note:
Never use the unsupported dict or putoperators in your option code. These operators are typically used inoption code dating back to Level 1 PostScript printers, which did notsupport the simpler << or >> operators.If you have old option code using dict or put, you canrewrite it very easily to use the newer << and>> operators instead. For example, the following codeto set the page size:
can be rewritten as:Supported Page Device Attributes
Table 2 shows the supported page device attributes along with PostScript code examples.Table 2: Supported Page Device AttributesName(s)TypeDescriptionExample(s)AdvanceDistanceIntegerSpecifies the number of points to advance roll media after printing.<</AdvanceDistance 18>>setpagedeviceAdvanceMediaIntegerSpecifies when to advance the media: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page.<</AdvanceMedia 4>>setpagedeviceCollateBooleanSpecifies whether collated copies are required.<</Collate true>>setpagedeviceCutMediaIntegerSpecifies when to cut the media: 0 = never, 1 = after the file, 2 = after the job, 3 = after the set, and 4 = after the page.<</CutMedia 1>>setpagedeviceDuplexBooleanSpecifies whether 2-sided printing is required.<</Duplex true>>setpagedeviceHWResolutionInteger ArraySpecifies the resolution of the page image in pixels per inch.<</HWResolution[1200 1200]>>setpagedeviceInsertSheetBooleanSpecifies whether to insert a blank sheet before the job.<</InsertSheet true>>setpagedeviceJogIntegerSpecifies 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.<</Jog 2>>setpagedeviceLeadingEdgeIntegerSpecifies the leading edge of the media: 0 = top, 1 = right, 2 = bottom, 3 = left.<</LeadingEdge 0>>setpagedeviceManualFeedBooleanSpecifies whether media should be drawn from the manual feed tray. Note: The MediaPosition attribute is preferred over the ManualFeed attribute.<</ManualFeed true>>setpagedeviceMediaClassStringSpecifies a named media.<</MediaClass (Invoices)>>setpagedeviceMediaColorStringSpecifies the color of the media.<</MediaColor >>setpagedeviceMediaPositionIntegerSpecifies the tray or source of the media.<</MediaPosition 12>>setpagedeviceMediaTypeStringSpecifies the general media type.<</MediaType (Glossy)>>setpagedeviceMediaWeightIntegerSpecifies the media weight in grams per meter2.<</MediaWeight 100>>setpagedeviceMirrorPrintBooleanSpecifies whether to flip the output image horizontally.<</MirrorPrint true>>setpagedeviceNegativePrintBooleanSpecifies whether to invert the output image.<</NegativePrint true>>setpagedeviceNumCopie

https://diarynote.indered.space

コメント

最新の日記 一覧

<<  2025年7月  >>
293012345
6789101112
13141516171819
20212223242526
272829303112

お気に入り日記の更新

テーマ別日記一覧

まだテーマがありません

この日記について

日記内を検索