======PPD Extensions====== =====Contents===== * [[https://www.linuxfoundation.org/#General|1 General]] * [[https://www.linuxfoundation.org/#User_interface_text:_Option.2C_preset.2C_choice.2C_and_tag_names|2 User interface text: Option, preset, choice, and tag names]] * [[https://www.linuxfoundation.org/#Custom_Options|3 Custom Options]] * [[https://www.linuxfoundation.org/#Multi-language_PPDs|4 Multi-language PPDs]] * [[https://www.linuxfoundation.org/#Presets|5 Presets]] * [[https://www.linuxfoundation.org/#Option_Tagging|6 Option Tagging]] * [[https://www.linuxfoundation.org/#CUPS_Options_and_Pre-Defined_Tags|7 CUPS Options and Pre-Defined Tags]] * [[https://www.linuxfoundation.org/#Widget_Hinting|8 Widget Hinting]] * [[https://www.linuxfoundation.org/#Icons_for_options_and_choices|9 Icons for options and choices]] ===== General ===== These specifications describe extensions to PPD files as described by Adobe's PPD specifications. All extensions are compliant with Adobe's specs, so that software which does not support these extensions can still use the extended PPDs, at least providing partial functionality. Software and facilities provided by OpenPrinting, especially the [[:openprinting:commonprintingdialog|Common Printing Dialog]], are intended to support these extensions wherever appropriate. They should not use other PPD extensions exclusively to achieve the same functionality. The extensions are intended to give driver developers/printer manufacturers better possibilities to provide user interfaces for their printer drivers than Adobe's PPD specifications supply. They especially allow to have options with advanced data types, PPDs with multiple UI languages, better option categorization (tagging), quick presets, icons for options and choices, printer manufacturer logos, ... To get the best out of the Common Printing Dialog also with legacy PPDs which do not use the extensions described here, each section specifies a fallback behavior of the dialog for the case that the option definition in the PPD does not use the appropriate PPD extension. The fallbacks are clearly marked with "**Fallback:**" in bold. Driver developers should not create PPDs based on these fallback methods but use the proper PPD extensions. For printing dialog developers it is not required but highly recommended to implement the fallbacks. **Note:** The Foomatic extensions mentioned here are planned and not implemented yet. They will be part of Foomatic 4.x. They are not directly needed for the Common Printing Dialog. They are only needed to generate PPDs with the extensions shown here with the help of Foomatic. ===== User interface text: Option, preset, choice, and tag names ===== The space for the widgets (UI elements) in the Common Printing Dialog is rather restricted. Therefore the text labels should not get too long. Some UI elements have even fixed widths, so that too long text gets cut. And also note that for expressing something in English you usually need less characters than for expressing the same thing in any other language using Latin letters. So leave some space so that also translations would fit. To get a feeling about possible text lengths, see the mock-ups of the dialog ([[http://wiki.openusability.org/printing/index.php/Specification|dialog UI specs]], [[http://www.mmiworks.net/eng/publications/labels/openPrinting.html|Peter Sikking's blog]]) or try the [[http://bzr.openprinting.org/devel/common-printing-dialog|Bazaar snapshots]] of the dialog under development. ===== Custom Options ===== As custom options we understand all kinds of user-settable printer options which cannot be represented by the option type defined in Adobe's PPD specifications. Adobe's specifications only define the option types boolean ("Boolean") and enumerated choice ("PickOne" and "PickMany") options. Modern printer drivers often require the user to supply data of more advanced data types like for example: * integer numbers - for example for number of copies, watermark angle * real numbers - interpreted linearly or exponentially, for example for color and brightness adjustments * lengths in points - for example for margin widths * strings - for example for user names and fax numbers * passwords - numerical or alphanumerical The Common Unix Printing System ([[http://www.cups.org/|CUPS]]) provides a set of extensions for PPD files to represent custom options. These are the extensions described in the "Custom Options" section in the [[http://www.cups.org/documentation.php/spec-ppd.html|CUPS specifications for PPD extensions]]. * PPD files must use these extensions for all options not representable as boolean or enumerated choice. * Options must use data types representable by standard PPD options or CUPS custom options. Other data types are not supported. **Fallback:** The only alternative but now deprecated method to describe options of advanced data types in PPD files are the Foomatic keywords as described in the [[http://www.openprinting.org/foomatic-db-engine/README|Foomatic documentation]] (See sections "Data", "String and Password Options", "Example for a Foomatic-generated PPD file", and "Foomatic keywords"). It is highly recommended but not required for a printing dialog to support these keywords so that the dialog offers its full functionality with as many PPDs as possible. ===== Multi-language PPDs ===== Adobe's specifications only describe a method to provide user interface text in one language for PPD file (the so-called "translations"). To support several languages the printer manufacturers ship one PPD for each language they support. On CUPS-based Linux/Unix systems there is a problem. A print queue has always only one PPD file and so only one user interface language can be provided. If there are users with different user inteface languages on their client desktops, these languages are not supported for the printer options. There is a CUPS extension for PPDs which allows several languages in one and the same PPD and so a printing dialog can select the language according to the language of the user's desktop. See section "Globalized PPD Support" in the [[http://www.cups.org/documentation.php/spec-ppd.html|CUPS PPD extensions]]. * PPDs shall use this extension to get a completely internationalized printing dialog, including translated names for printer-specific options and choices. **Fallback:** Conventional one-language PPDs should be shown in their language by the printing dialog. The dialog can provide translations for common strings in PPDs (like "PageSize", "Resolution", ...) and this way show options or choices translated in the case of English-only PPDs or PPDs with missing translations. ===== Presets ===== The "Presets" are preselected option settings for common printing tasks (like we page, letter, photo, ...). They can be used by choosing them from a drop-down menu in the printing dialog (preferably in the standard view of the main printing dialog). The presets could be named for example as "Draft", "Normal quality document", "High quality document", "Photo". Then "Draft" would for example set a low resolution and toner saving mode, "Photo" would set a high resolution, no ink/toner saving, photo paper, ... So the user can quickly set several options for his printing task by one single click. For the presets CUPS also [[http://www.cups.org/documentation.php/spec-ppd.html#APPrinterPreset|already specifies a PPD extension]]: *APPrinterPreset Document/Office Document: "*Resolution 600dpi *MediaType Plain" *APPrinterPreset Photo/Photo: "*Resolution 1200dpi *MediaType Glossy com.apple.print.preset.graphicsType Photo" *End ... The general syntax of the "*APPrinterPreset" keyword is *APPrinterPreset /: "* [* ...] [ " ... with being a unique name for the quick preset, not containing spaces, the text which should appear in the drop-down list if the user has an English desktop or if no translation for his desktop language is available. Between the quotes there can be any number of option settings specified by "*