Next Page > Hide TOC

Creating Printing Presets for iPhoto

This document shows you how to create a printing presets file that can be used with the iPhoto application. Printing presets are printer-specific collections of settings which have associated metadata. The metadata describes the situation in which the printer settings should be applied by the printing system. For example, a given preset might be appropriate when printing high-resolution photo images to glossy paper. The metadata describes this situation in a general manner, while the printer specific settings describe which key-value pairs achieve the desired effect on a given printer.

If you are a printer vendor who wants to support printing presets you should read this document. This document

Important: This is a preliminary document. Although it has been reviewed for technical accuracy, it is not final. Apple Computer, Inc. is supplying this information to help you plan for the adoption of the technology described herein. This information is subject to change, and software implemented according to this document should be tested with final operating system software and final documentation.

For information about updates to this and other developer documentation view the New & Updated sidebars in the ADC Reference Library. To receive notification of documentation updates, you can sign up for ADC's free Online Program and receive their weekly Apple Developer Connection News e-mail newsletter.

Apple’s iPhoto application helps users to save, organize, and share photos by simplifying the user experience. Before iPhoto, users needed to understand the interrelationships between paper type and other print settings to get the best printing results. With iPhoto, this is no longer true. The simplified Print dialog in iPhoto presents users with a Presets pop-up menu. The Presets setting determines which set of printing presets are used for the print job. This saves the user from the need to navigate to different panes in the Print dialog to make settings for paper type, resolution, and so forth.

When iPhoto was introduced, Apple supplied printing presets files for many printer models. Developers can provide a printing presets file for a printer by creating a file whose contents follow the format specified in the next section. The Apple-supplied printing presets file is used only if a printer module does not have a printing presets files supplied by the printer vendor.

Note: Printing presets differ from custom settings. Printing presets are defined by a developer for printer module and include metadata which allows the settings to be applied across different printers. In the implementation, the preset metadata allows the printing system to apply a preset across printers. For example the printer preset for "Photo on Photo Paper" can be applied either to an Epson or an HP printer and the correct settings are enforced.

In this section:

Printing Presets File Format
Installing a Printing Presets File
Sample Printing Presets File


Printing Presets File Format

The printing presets file uses XML format and can be viewed by using the PropertyListEditor application provided in the /Developer/Applications directory. Printing presets files are named using printer module’s ID with the .xml extension. For example:

com.abccompany.printer.ZQ3700.xml

where com.abccompany.printer.ZQ3700 is the printer module ID.

A printing presets file describes an array of dictionaries. Each dictionary is a collection of key-value pairs that describes a single preset value—a combination of general metadata and printer specific settings.

The preset dictionary can have the following keys:

Installing a Printing Presets File

After you create a printing presets file for your printer module, you need to name the file Presets.xml and put it in the Resources directory of the printer module. The XML file is not localizable so you must put the printing presets file at the top level of the Resources directory; do not put the file in any of the language (.lproj ) sub-directories.

The complete path for your printing presets file must be:

/Library/Printers/vendor/.../vendorPM.plugin/Contents/Resources/Presets.xml

For example, the location of ABC printer company’s printing presets file for the SpiffyPrint model BL2300 printer would be:

/Library/Printers/ABC/SpiffyPrint/BL2300PM.plugin/Contents/Resources/Presets.xml

As long as your file is installed in the correct location, the printing systems uses your printing presets file even if Apple provides a file for your printer module. In other words, your printing presets file takes precedence over a file supplied by Apple.

Apple-supplied printing presets files are located in this directory:

/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Resources/

Sample Printing Presets File

Listing 1-1 shows a sample printing presets file. You can find other examples of properly formatted printing preset files in the this directory:

/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Resources/

You can use the PropertyListEditor application to view the files.

Listing 1-1  A sample printing presets file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<array>
 
    <dict>
        <key>com.apple.print.preset.id</key>
        <string>Photo on Plain Paper</string>
        <key>com.apple.print.preset.graphicsType</key>
        <string>Photo</string>
        <key>com.apple.print.preset.quality</key>
        <string>mid</string>
        <key> media-front-coating </key>
        <string>none</string>
        <key>com.apple.print.preset.settings</key>
        <dict>
            <key>com.xx.setting.A1</key>
            <integer>0</integer>
            <key>com.xx.setting.A2</key>
            <string>plain-12bond</string>
        </dict>
    </dict>
 
    <dict>
        <key>com.apple.print.preset.id</key>
        <string>Photo on Matte Paper</string>
        <key>com.apple.print.preset.graphicsType</key>
        <string>Photo</string>
         <key>com.apple.print.preset.quality</key>
            <string>mid</string>
         <key> media-front-coating </key>
         <string>matte</string>
        <key>com.apple.print.preset.settings</key>
        <dict>
            <key>com.xx.setting.A1</key>
            <integer>21</integer>
            <key>com.xx.setting.A2</key>
            <string>32 bump</string>
        </dict>
    </dict>
 
</array>
</plist>


Next Page > Hide TOC


© 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-07-07)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.