Foomatic Database ================= Índice de contenido Foomatic Database 1 1) foomatic-db 1 2) Copying 2 3) Intro 2 4) Programs and important files from this package 3 5) Dependencies 3 6) About the database 4 6.1) Data 4 6.2) printer/HP-LaserJet_4000.xml 12 6.3) driver/md2k.xml 17 6.4) Composite Options 20 6.5) Forced Composite Options 25 6.6) String and Password Options 28 6.7) Option Grouping 34 6.8) Unprintable margins 36 6.9) Adding arbitrary extra entries to the PPD file 39 1) foomatic-db ----------- The collected knowledge about printers, drivers, and driver options in XML files, used by foomatic-db-engine to generate PPD files. Grant Taylor Till Kamppeter http://www.linuxprinting.org/ This README contains mainly info for developers. See the file USAGE if you want to know how to use Foomatic. This is the development line 3.1.x of Foomatic, for production, use the stable line 3.0.x. 2) Copying ------- To most of this package the GPL applies (see http://www.gnu.org/), exception are the PPD files in db/source/PPD, they can have different licenses (mostlu MIT), see the comments in the beginning of the PPD files. If you spot a data error or any other bug, send mail describing the bug to foomatic-devel@linuxprinting.org General discussion happens in the foomatic-devel forum/list thing at www.linuxprinting.org. 3) Intro ----- This is the stable version of Foomatic. See http://www.linuxprinting.org/contribute.html#programming http://www.linuxprinting.org/pipermail/foomatic-devel/2002q3/thread.html http://www.linuxprinting.org/pipermail/foomatic-devel/2002q4/thread.html http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/IV.Foomatic-Developer/IV.tutorial-handout-foomatic-development.html to know more about its development. Your suggestions, bug reports, patches, ... are welcome on http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.foomatic.devel This database is the base of our web site: http://www.linuxprinting.org/ 4) Programs and important files from this package ---------------------------------------------- configure.in The source from which GNU autoconf generates the "configure" script acinclude.m4 Additional macros for the "configure" script make_configure Calls aclocal and autoconf to generate "configure" from "configure.ac" and "acinclude.m4" Makefile.in The template from which "configure" generates the Makefile install-sh Helper script for "configure" db/ The XML database. See below. 5) Dependencies ------------ This package does not require anything else. It is needed by foomatic-db-engine, the database engine of Foomatic. It is highly recommended to use foomatic-db-engine 3.1.0 or newer, as it contains important bug fixes and also support for boolean options being member options of the composite options. It also supports the definitions of unprintable margins, of extra lines for the PPD files, and of the "" and "" tags in the auto-detection sections of the printer entries. Do not use this database with Foomatic 3.0.x or older, as this database make use of new functionality introduced in Foomatic 3.1.x. See the USAGE file for installation details. 6) About the database ------------------ The database is provided by the "foomatic-db" package, additional database entries are in "foomatic-db-hpijs", other "foomatic-db-..." packages or are supplied with the drivers. "foomatic-db" is required for using the programs provided by this package. There is a $libdir, somewhere. Underneath $libdir there are (Install "foomatic-db" at first and then this package. Then the $libdir will be auto-detected): db/ - the database db/oldprinterids - translation table for old numerical printer IDs db/kitload.log - list of third-party "kit" files db/source/ - "source" data, provided by humans, etc db/source/printer/.xml - printer-specific data, one per printer id db/source/driver/.xml - driver-specific data, one per driver name db/source/opt/.xml - option data, one file per option You can edit the files whenever you want and regenerate the affected printer queues with foomatic-configure, there is no on-disk cache (it is not needed, the database handling is fast enough), the data is always directly derived from the source files. So you changes will be taken into account without any special steps. 6.1) Data ---- There are three main source datafiles; annotated examples: source/opt/2.xml ================ # Every option exists independently from printers or drivers, because # they might apply to arbitrary combinations of printers and/or # drivers. In practice, some drivers have wholly unique options # (gimp-print/stp, for example), while others (lots of generic basic # Ghostscript drivers, for example) share some options. # To allow custom page sizes to be used one has add a choice with the # "" being "Custom" to the "PageSize" option (example # below). This choice will be treated as the custom page size. When # the user selects this choice, he has to provide the width and the # height of the page in addition. These values are converted into # PostScript points (1/72 inches) and inserted into placeholders in # the "" of this choice. The "" should # contain a placeholder "%0" for the page width and "%1" for the page # height. Alternatively the "" can contain two zeros # ("0") from which the first will be replaced by the page width and # the second by the page height. Then one gets Adobe-compliant entries # for the custom page size in the PPD files and one can set a custom # page size with the following commands: # CUPS: lpr -P huge -o PageSize=Custom.500x750cm bigposter.ps # LPRng: lpr -P huge -Z PageSize=Custom.500x750cm bigposter.ps # GNUlpr: lpr -P huge -o PageSize=Custom.500x750cm bigposter.ps # LPD: lpr -P huge -JPageSize=Custom.500x750cm bigposter.ps # PPR (RIP): ppr -P huge -F "*PageSize Custom" --ripopts 500x750cm # bigposter.ps # PPR (Int.): ppr -P huge -F "*PageSize Custom" -i 500x750cm bigposter.ps # PDQ: pdq -P huge -oPageSize_Custom -aPageWidth=500 # -aPageHeight=750 -oPageSizeUnit_cm bigposter.ps # No spooler: foomatic-rip -P huge -o PageSize=Custom.500x750cm # bigposter.ps # Here is an example for a custom page size setting: # # # Custom size # # # # Custom # # # %0 %1 # # The entry # 0 0 # would have the same effect as the of the example. # For numerical (int, float) and bool options there is no # section. Instead of this section numerical options have tags to # specify minimum and maximum value: # 10.0 # 0.0 # For the %s in the a number, either the user's choice # when he has specified this option or the default value is # inserted. Only numbers between the minimum and the maximum and in # case of int options only integer numbers are allowed. # Bool options can be set or not be set. There will be # inserted if they are set, nothing if they are not set. A %s in the # is not allowed, there is nothing to insert for it. As # in the option's constraints one can use 0 for not # setting the option by default or 1 for setting it by default. # Bool options need the specification of a name for the case when they # are not set. This will be used by GUIs and in PPD files: # # CorrectBlack # # This name should not contain spaces, ":", or "/". # See below for string and password options. 6.2) printer/HP-LaserJet_4000.xml ============================ # The printer file contains information specific to a particular # printer. # Make and model are not internationalized. There will eventually be # an "alias" mechanism, but the need is different. HP LaserJet 4000 # According to the Adobe specifications for PPD files every PPD file # must contain a unique DOS-compatible file name (the "*PCFileName"), # a file name with an up to 8 characters log base name and an up to 3 # characters long extension, and upper and lower case letters being # considered as equal. As every PPD file is for a printer/driver # combo, we let the first 6 characters being provided by the printer # entry: HPLJ4K # The first two characters should be the manufacturer prefix as listed # in Appendix D of Adobe's "PostScript Printer Description (PPD) File # Format Specification Version 4.3", available on # http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf # Various stuff about the machine # Printer types can be , , , , # , , . Other types we have to # add to the CGI script on linuxprinting.org to make the web interface # displaying them properly. # At some point we can make color be less of a boolean flag and more # of a section full of goodies. # In theory this is a list. In practice We've only got one per # printer which is the maximum resolution the manufacturer claims # for this printer. 1200 1200 # Information about ink, drums, etc. # The comments are supposed to be qualitative ("Separate drum and # toner cartridges") toner # There should be 12A1975 elements with manufacturer # part numbers for the various carts, etc it takes. Then one could # have a price watcher thingy like there is now for the printers. http://www.pandi.hp.com/pandi-db/prod_info.show?model=C4118A&name=LaserJet4000 # The lang section. In practice this will be only minimally useful; # # - Backends can pstops the ps down a level if needed # - Backends know if pjl options apply # - Backends can know if "quick text" will work # # Commonly used language tags: , , us-ascii # The autodetection stuff # There are three ways to auto-detect a printer, via the parallel port # (...), the USB (...), or SNMP # (TCP/Socket-connected printer, ...). Through these # interfaces the printers report back an IEEE-1284-complient ID string # from which the fields "MFG" (...), # "MDL" (...), "DES" (...), # and "CMD" (...) are used. The string itself # can be put between ... tags, but all items # which are not constant for all printers of this model, as the serial # number ("SERN:...;") and the device status ("VSTATUS:...;") have to # be removed here. As the ID string is usually the same for all # detection methods, one can put the entries between # ... tags, then the ..., # ..., and ... are only used for # differences to the data between the ... tags. A # complete entry could look like: # # # # MFG:HEWLETT-PACKARD;MDL:DESKJET 600;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DeskJet 600; # MLC,PCL,PML # Hewlett-Packard DeskJet 600 # HEWLETT-PACKARD # DESKJET 600 # # # # On Linux you find this info for the parallel ports (/dev/lp, # = 0, 1, 2, ...) in the files # # /proc/sys/dev/parport/parport0/autoprobe* # # for the USB under Linux it is more complicated, easiest is to use a little # Perl script, called "getusbprinterid.pl": # -------------------------------------------------------------------------- #!/usr/bin/perl open FILE, "$ARGV[0]" or die; my $result; # Calculation of IOCTL function 0x84005001 (to get device ID string): # len = 1024 # IOCNR_GET_DEVICE_ID = 1 # LPIOC_GET_DEVICE_ID(len) = _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len) # _IOC(), _IOC_READ as defined in /usr/include/asm/ioctl.h ioctl(FILE, 0x84005001, $result) or die; close FILE; # Cut resulting string to its real length my $length = ord(substr($result, 1, 1)) + (ord(substr($result, 0, 1)) << 8); $result = substr($result, 2, $length-2); # Remove non-printable characters $result =~ tr/[\x0-\x1f]/\./; print "$result\n"; # -------------------------------------------------------------------------- # Running the program with "./getusbprinterid.pl /dev/usb/lp0" returns the # ID string of the device on /dev/usb/lp0. # Our grading system. It's US-style letter grades A, B, D, and F, # which the website shows as "Perfectly", "Mostly", "Partially" and # "Paperweight" . # THERE IS NO `C'!!! A # Arguably, the scores should live with the printer/driver association # and not on the printer, but then it's a big hassle to figure out if # a printer works... So the score is the one reached with the driver # working best, the "recommended" driver. # There's a spot for this "recommended" driver, usually the driver # which gives the maximum output quality. It is for user information # on the web site, but newbie-friendly printer setup GUIs should use # it, too. Unfortunately, only "printerdrake" of Mandrake Linux makes # use of it. # The tag was on all printer entries which were # formerly entered by visitors using the web printer input interface # as the database was still PostGreSQL-driven. # If there is a web site with additional interesting info about this # printer, it can be mentioned in the entry by putting it between # ... tags, # The regular notes section. The allowed tags are:

, and many other simple tags (, , , # ...). Not that to distinguish what is XML and what is the embedded # HTML, make the following replacements: # # < --> < # > --> > # " --> " # ' --> ' # & --> & # I don't believe this:<p> <i>1200x1200 dpi only possible with Windows drivers, 600x600 can be reached w/o particular software. The difference is visible, but only slightly, so the Functionality got "Mostly"<p></i><p> Do the following:<p> Set the resolution on the front panel to "Prores 1200", not to "Fastres 1200". When you use CUPS with HPs PPD file, turn off "Fastres 1200" in the printer configuration options.<p> Try the generic PostScript PPD file which comes with KUPS 1.0 or newer. 6.3) driver/md2k.xml =============== The driver files contain information about drivers. There are a few things, but the two biggies are the prototype and the printers list md2k # According to the Adobe specifications for PPD files every PPD file # must contain a unique DOS-compatible file name (the "*PCFileName"), # a file name with an up to 8 characters log base name and an up to 3 # characters long extension, and upper and lower case letters being # considered as equal. As every PPD file is for a printer/driver combo, # we let the last 2 characters being provided by the driver entry: M2 http://plaza26.mbn.or.jp/~higamasa/gdevmd2k/ # Driver types are # # : The driver code is compiled into GhostScript # # : The driver code is a separate executable, either a # filter which converts generic bitmap output of # GhostScript to the printer's language, a wrapper # around GhostScript, or an IJS plug-in. # # : A uniprint driver, consisting of one or more .upp # files for GhostScript. # # : A driver which has PostScript also as output (for # PostScript printers). It usually does not call # GhostScript but only applies the user's option # settings to the data stream. But GhostScript can # be called here, too, as for downgrading to a lower # PostScript level. # # The driver type only provides information for the web pages, it is not # used when generating config files for a spooler. # The driver's section can also contain a # # # # which suppresses the usage of PJL options (options which send PJL # commands to the printer). This one does with drivers where the # driver itself already produces a PJL header, the second one built # by the PJL options would then be ignored by the printer, and so # this kind of options does not make sense. Such driver are for # example "hpijs" and "hl1250". # The prototype defines what command the backends run to drive this # printer. It must take postscript on stdin and generate "printer # stuff" on stdout. Various %A, %B, etc substitution "spots" are # specified; this is where substition options will be placed. gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sDEVICE=md2k%A%Z -sOutputFile=- - Part of the gdevmd2k-0.2a package by Shinya Umino. The web page and documentation are in Japanese. <a href="/clippings/MD5000-translation.txt">Here</a> is an English translation of the driver's web page, and <a href="/clippings/alpsmd.txt">here</a> is the README from the driver package. # The printer list is a simple list of printers that this driver works # with. Historically, these "bits" were on the printer cgi form page, # but now they're put here. printer/Alps-MD-1000 printer/Alps-MD-1300 printer/Alps-MD-2000 printer/Alps-MD-4000 # In the printer list it is also possible to place comments specific to # a certain printer/driver pair: # # # printer/HP-LaserJet_4050 # # to 1200dpi # # 6.4) Composite Options ----------------- This is a new option type to make it easier for users to choose the best settings for a certain printing task, even if the driver has very many options. The idea is to have an enumerated choice option which does not directly modify something in the driver's command line but sets several of the other options. One example is the "PrintoutMode" option which will be made available for all printer/driver combos which have at least one option regarding the printout quality or document type. The possible choices should be the same for every printer and driver, so that users (especially newbies) can bring their printers in the right mode by choosing one easy to understand item from a menu instead of having to switch several cryptic driver options. For now the choices are the following: Command line GUI Intention ----------------------------------------------------------------------- Draft Draft Very fast, ink/toner-saving printout Normal Normal Quick standard quality printout High High Quality High quality for plain paper VeryHigh Very High Quality Highest quality for plain/inkjet paper Photo Photo Highest quality for photo paper These choices can also have one of the following modifiers: Modifier Intention ----------------------------------------------------------------------- .Gray Grayscale printing on a color printer .Mono Monochrome printing (no grayscales, black or white) Examples: Command line GUI Comment --------------------------------------------------------------------- High.Gray High Quality Grayscale Photo Photo Color photos on color printer VeryHigh.Mono Very High Quality Monochrome Really black text in highest quality on inkjet printer, not suitable for halftone images. Normal Normal Standard color in 300/360 dpi on normal paper, grayscale on black-and-white printers Not all choices/combinations of basic choices and modifiers must be present. Often modes are simply not available on certain printer/driver combos, as "Photo" on most lasers. It is highly recommended to have "Normal" available, though (and having this the default). The GUI names can have additional remarks in parantheses, for example when manual intervention (other cartridge, photo paper) is needed. To add such an option to the database, one only needs to add an option XML file like the one below into the db/source/opt directory of the database. The file db/source/opt/pcl3-PrintoutMode.xml could look like this: -------------------------------------------------------------------------- -------------------------------------------------------------------------- The shown option is only an example, it is neither in the CVS nore will it work with all printers which use the "pcl3" driver. You can paste it into a file (make the "s being one line, the items separated by spaces) and copy it to db/source/opt/ to try it out. The "" tag for the execution style specifies it as a composite option. The and are meaningless in a composite option and the ""s contain a space-separated list of all settings of which the pre-made configuration represented by this choice consists. Every choice of the composite option must set EXACTLY THE SAME individual options. In no choice it is allowed to leave out one of them. These individual options are the member options of the composite option. Not all options of a driver/printer combo need to be member options of the composite option. It is not allowed to have one option being member of more than one composite option. The composite option must be an enumerated choice options, the member options must be enumerated choice or boolean options. Member options can even be composite options, so composite options can be nested. It is enough to add a composite option as shown. The PPD generator (getppd() in lib/Foomatic/DB.pm, package "foomatic-db-engine") will take care of the rest. It will - Order all member options into a group (PPD group, see "Option Grouping" below) named after the composite option. - Add to every member option the choice "Controlled by ''" and make this choice the default. If this is chosen, the composite option will set the value for this member, depending on what value is chosen for the composite option. If the user chooses something else than "Controlled by ''" the member option does not obey the setting given by the composite option. So the advanced user can also set the member options individually. - If necessary the and of the composite option is replaced by other values in the PPD file, so that the composite option will be stuffed into the PostScript data stream always before all its member options. Do not give "0" as the order number to any of the member options. A composite option can also span only one (but not zero) member option. This is for example done with the "PrintoutMode" option of the HPIJS driver ("foomatic-db-hpijs" package). This driver has only one option for setting resolution and quality, but this options has sometimes many choices with rather cryptic names. The "PrintoutMode" maps to the most important choices with the above-mentioned names, and in addition, these names are the same as of the "PrintoutMode" options of other drivers, so the user finds the important printing modes more easily. The facility of composite options can also be used for other things than for a "PrintoutMode" option, for example a finisher could be controlled by a composite option (to have the most common finishing tasks as "Bound booklet", "Stapled booklet", "Letter in envelope", ...). 6.5) Forced Composite Options ------------------------ Forced composite options are very similar to composite options, but the user cannot set the individual member options, but only the composite option (the user is forced to use the composite option). This allows options acting at two or more places. Example: A printer driver is a filter which converts a generic bitmap produced by GhostScript to the printer's native format. The command line for converting PostScript to the printer's language could look like this gs -q -dBATCH -dSAFER -dNOPAUSE -sDEVICE=bitcmyk -r600 -sOutputFile=- - | filter -size=x where and is the page size in points (1/72 inches). In addition, GhostScript needs to know the page size. For this one usually puts the following PostScript code into the PostScript input file: < ]/ImagingBBox null>>setpagedevice where and is again the page size in points. So we need two options for setting the page size, one PostScript option to set the page size for GhostScript and one command line option to set the page size for the filter. The user would have to change both when he wants to print on another paper size, and it does not make sense to have different settings for the two. So one could make the "PageSize" option a composite option of the two, but then the GUI exposes an ugly "PageSize" group with the two individual options. To avoid this, one uses a forced composite option ("Forced" because the user is forced to use the composite option, the individual member options are not accessible). Assuming that the name of the PostScript option for the page size is "GSPageSize", the name of the page size option for the filter is "filterPageSize" and both have the choices "A4", "Letter", and "Legal", the forced composite option named "PageSize" would look as follows: -------------------------------------------------------------------------- -------------------------------------------------------------------------- This looks exactly like a usual composite option and works also the same way. The only difference is that instead of an "" tag "" is used. If the PPD generator finds such an option, it hides the member options by only using "*Foomatic..." keywords to describe them, not any standard PPD keywords as "*OpenUI...", "*OrderDependency...", ... This way PPD-aware graphical frontends do not see the member options but foomatic-rip has all information from them to run the driver correctly. 6.6) String and Password Options --------------------------- These options allow the user to supply nearly arbitrary strings (within limits of length, characters and structure) to the printer driver, for example names of color calibration files, fax numbers, passwords for confidential jobs, ... Frequently needed strings can be added as enumerated choices, so a frontend can show the option as a combo-box. The enumerated choices are also used for frontends which only support options as defined by the PPD spec. So having enumerated choices is highly recommended for most of these options. In the XML database string and password options look similar to enumerated choice options. The differences are the option types "string" or "password" and the additional tags to restrict the possible strings. The "" tags give a length limit, it should once not allow strings longer than around 100 characters, as otherwise foomatic-configure could generate a line longer than the allowed 255 characters in the PPD file when setting the default value, and second, which is very important, it should not allow strings which are too long for the printer filter or driver so that buffer overflows cannot occur. Not using the "" tags makes arbitrary long strings to be accepted, this is not recommended. With "" the accepted strings can be restricted to contain only the characters given in the list. This restrictions does not only avoid that the filter chokes on a wrong option, it serves mainly for security reasons, for example to avoid a string like "|| rm -rf * ||" for a command line option. So if the option prototype does not quote the string, command delimiter characters, I/O re-directors, and shell special characters (";", "|", "&", "<", ">", "*", "?", "[", "]", "{", "}", "(", ")", "$", "\", "'", """) should not be allowed. If the string is quoted by the option prototype, the closing quote character and the backslash should not be allowed, so that one cannot escape from the quoting. The allowed characters are checked by a "/^[...]*$/" expression in the Perl scripts, so ranges with "-", a list of forbidden characters with a leading "^", or special characters as "\w", "\d", "\x07", ... are allowed. To allow a backslash, one has to escape it by using two backslashes ("\\"). To allow a "-" it must be in the end of the list to not make it defining a range and for a "^" must be placed at any other place than the beginning of the string if it should be explicitly allowed. "" allows also to restrict the structure of the string, as it defines an arbitrary Perl regular expression (see "man perlre") which has to be matched by the string. This serves also for having only strings which are usable by the filter and which do not destroy the command line structure. With this one can for example forbid a backslash as the last character to avoid escaping the closing quote of the option prototype. Regular expressions are applied via a '/.../' expression in the Perl scripts. To apply the pattern matching modifiers "i", "m", "s", or "x" (as "/.../i" for case-insensitive matching) begin the regular expression with "(?)" (as "(?i)..." for case-insensitive matching). It is highly recommended to use at least one of "" and "", as otherwise all characters are allowed in the user-supplied string and so a malicious user can execute arbitrary shell or PostScript commands. If both tags are used, both conditions have to be fulfilled. Note that for the character lists and regular expressions in the XML files the following character substitutions have to be done: < --> < > --> > " --> " ' --> ' & --> & Here is an example for an option to supply the file name for an ICC profile for the "foo2zjs" driver (this option is neither in the CVS for the Foomatic database nor tested with this driver): -------------------------------------------------------------------------- -------------------------------------------------------------------------- This option allows to choose either one of the given file names, either by using the ""s or the ""s, or one can give every arbitrary other file name with a maximum length of 127 characters, only containing letters, digits, periods, underscores, dashes, and slashes, and not having a slash in the end (no directories). Note that in Perl the period must be escaped by a backslash to be taken literally, otherwise it stands for an arbitrary character. The regukar expression for blocking out strings ending with a slash is "(?" may differ from the "", the string inserted at the "%s" place holder in the "" is always the "", independent whether the user supplies the "" directly or the "". In this example both lpr -o ICM= file.ps and lpr -o ICM=None file.ps supply an empty string as the value of the ICM option. For the default value there must be an enumerated choice, if there is none, the PPD generator will create one. So this entry is allowed (this option is only an example, it is not in the CVS of the Foomatic database): -------------------------------------------------------------------------- -------------------------------------------------------------------------- The default value is an empty string here. So the PPD generator will add a choice for the empty string. Normally, automatically added choices get the same "" as the string itself, but if the string is not allowed as an option name in a PPD file, the "" will be modified. For an empty string (as in the example above) "None" will be used and all characters except numbers, letters, and underscores ("_") will be replaced by underscores. The option types "string" and "password" are treated exactly the same way by the PPD generator and by foomatic-rip, the different names are only for frontends to know whether the input field should display the typed characters or asterisks on the screen. 6.7) Option Grouping --------------- All options should be put in groups (with the tags "..." in the "" section of the option XML files, see above). This way many GUIs sort the options into tabs or tree branches according to the groups. This way one gets only the most important options on the first tab and not so often needed ones on additional tabs. This also overrides the automatic option grouping of CUPS (Groups "General" and "Extra"). It is recommended to have the options in groups as follows (plus perhaps special groups, but not one group for every option): General Here go options which are most used on a job-by-job basis, as the options for paper type, size, and tray, ink type, duplex, ... and all options affecting the printout quality, as resolution, dithering, ... and especially "PrintoutMode". If a "PrintoutMode" option is present, all quality-related options covered by the "PrintoutMode" option go into the automatically created "PrintoutMode" group (see above). And this is intended, these options are now usually controlled by "PrintoutMode" and so they are not the most important options for the first tab any more. Do not put color/brightness/gamma, ... options here, they go to "Adjustment". Options typically to go here are: o PageSize o InputSlot o MediaType o InkType o Duplex o PrintoutMode o Resolution o REt o Dither o FastRes o Economode o ... All options mentioned after "PrintoutMode" will usually be used as member options for "PrintoutMode", they are only in this group when there is no "PrintoutMode" option. PrintoutMode This group only exists if there is a "PrintoutMode" option, because it is generated by this option. It contains the member options of "PrintoutMode". Typical candidates are o Resolution o REt o Dither o FastRes o Economode o ... They do not need an "PrintoutMode" line, they are put into this group automatically. You should better put an "General" line into these options, so that they go into the "General" group when there is a printer/driver combo for which no "PrintoutMode" option applies. Adjustment Options for correcting the appearance of colors, contrast, ..., for head alignment, ... etc. Here most numerical options will go, but also things like "Density", also if it is an enumerated choice option. Typical candidates are: o Gamma o Brightness o Contrast o Density o Saturation o Cyan o Magenta o Yellow o ... Finishing If a printer has a stapler, folder, cutter, envelope packer, or similar devices to do additional processing on the ready printout, the options to control this stuff go into this group. Examples: o Stapling o Binding o Cutting o Booklet o ... Miscellaneous Options which do not fit into the mentioned groups and for which it is not worth to make a special group. 6.8) Unprintable margins ------------------- On most printers you cannot print arbitrarily close to the borders of the paper. You usually will have margins of certain width on which you cannot print. For filters and applkication programs to know about these margins PPD file have "*ImageableArea" lines which define the positions of the lower, the upper, the left, and the right borders of the area on which the printer can print. There is one line for each paper size listed in the "*PageSize" option. To conveniently generating these lines one can use the following XML structure in the Foomatic database entries: -------------------------------------------------------------------------- pt 9 36 18 18 0 0 0 10 585 ... ... -------------------------------------------------------------------------- This structure is allowed in printer entries in the "" section and in driver entries in the "" section or inside a "" entry of the driver's printer list. In the "" section of a driver entry the margins are valid for all printers used with this driver, in a "" entry they apply only to the given printer/driver combo. The shown example could be for the HP PhotoSmart 7150/7350, which does full-bleed only on HP's special photo paper with an 0.5 inch wide tear-off tab on the lower border (and some other paper sizes used in the photo tray). On all other paper sizes the printer leaves white borders of half an inch at the top and at the bottom and a quarter of an inch on the left and right hand side (1 inch are 72 pt). In addition, the page size "A4" allows to print up to 10 points to the left and the right borders. At first we give the general borders ("" section) where we choose the unit "pt" (PostScript points) for the numbers. These borders are valid for all paper sizes which are not explicitly mentioned with an "" section. For our printers one of the exceptions is the 4x6 photo paper with the tear-off tab (including the tab the paper is 4x6.5 inches large). here the printer prints up to the left, right, and top borders. Therefore we have margins of zero here. At the lower border the printer still leaves half an inch white (therefore probably HP introduced the tear-off tab), so we keep the 36 pt of the "" section by not mentioning a new lower border. For A4 we redefine the left and the right border. This is also possible in absolute PostScript coordinates measured from the lower left corner, as we do here. We indicate this with the "" tag. The left border is at 10 pt from the left, and as A4 paper is 595 pt wide, the right border is at 585 points from the left. One hint for the choice of the units: Float numbers as border widths are allowed, but it is recommended for having exact info to choose a unit which gives integer numbers for the widths (which is always possible with the "dotsNNNdpi" unit with NNN being the maximum resolution of the printer). A "" section in a printer entry should represent the printer's hardware capabilities. Such a section in a driver entry should represent how the driver's limitations are. If there are margins defined in both the printer and the driver entry of the desired printer/driver combo, the more restrictive (wider) borders count. If there are no border definitions in both the printer and the driver entry, the borders are assumed to be of zero width (full-bleed). 6.9) Adding arbitrary extra entries to the PPD file ---------------------------------------------- The "" tags allow to add extra lines to the PPD file. The tags can be put into the top level ("") of a printer XML entry, into the "" section of a driver XML entry, or into the "" entries of the printer list in a driver XML file. They serve mainly to put a default resolution into PPD files for drivers without "Resolution" option. Examples: "hpijs" driver, default resolution for HP DeskJet 350. For this driver the default resolution depends on the printer class. Therefore the appropriate ""s have to be in the printer entries of the printer list: -------------------------------------------------------------------------- hpijs ... printer/HP-DeskJet_350C *DefaultResolution: 600dpi in 0.25 0.25 0.125 0.67 0.135 0.135 ... -------------------------------------------------------------------------- "pnm2ppa" driver: This driver has no "Resolution" option, and all printers print in 600 dpi with it. So we put the "" into the "" section: -------------------------------------------------------------------------- pnm2ppa http://sourceforge.net/projects/pnm2ppa/ gs -q -dNOPAUSE -dPARANOIDSAFER -dBATCH -r600%A%Z -sOutputFile=- - | pnm2ppa%C%B -i - -o - *DefaultResolution: 600dpi ... -------------------------------------------------------------------------- Note that leading spaces are removed from the lines between the "" tags before they get inserted into the PPD file. The lines are added at the end of the PPD file header, right after the lines for the basic hardware capabilities of the printer.