UIPrintInfo Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/UIKit.framework |
| Availability | Available in iOS 4.2 and later. |
| Companion guide | |
| Declared in | UIPrintInfo.h |
Overview
A UIPrintInfo object encapsulates information about a print job, including printer identifier, job name, output type (photo, normal, grayscale), orientation (portrait or landscape), and any selected duplex mode. This information is used by the printing system when it prints.
Typically you create a UIPrintInfo object and assign it to the printInfo property of the shared UIPrintInteractionController instance. However, it is not necessary to create a UIPrintInfo object for a print job; UIKit assumes certain defaults. In the printing-options user interface, users can select the printer, single-side or double-side printing for duplex printers, and (if the application allows it) a range of pages to print.
Tasks
Creating a UIPrintInfo Object
Getting and Setting Print-Job Attributes
-
duplexproperty -
jobNameproperty -
orientationproperty -
outputTypeproperty -
printerIDproperty
Properties
duplex
Specifies the duplex mode to use for the print job.
Discussion
Some printers can print either duplex (double-sided) or single-sided. If double-sided is selected, a printer can either print flipping the back page along the long edge of the paper or along the short edge. The default option for duplex-capable printers is based on document type: single-sided (none) for photos, double-sided and long edge for other documents. If a printer is capable of duplex printing, a switch in the printing options allows users to toggle between single-side and double-sided printing. See the description of the UIPrintInfoDuplex constants for more information.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.hjobName
The name of the print job.
Discussion
The name of the print job is displayed in the Print Center when the job is printing. An application should set this property to a name appropriate to the content being printed. The default job name is the application name.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.horientation
The orientation of the printed content, portrait or landscape.
Discussion
An application can set this property to a value thats appropriate to the printable content or it can put up a user interface that enables users to pick the printing orientation. The default value is UIPrintInfoOrientationPortrait. See the descriptions of the UIPrintInfoOrientation constants for more information.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.houtputType
The kind of printable content.
Discussion
The output type can be general, photo, or grayscale. An application can set this property to a value thats appropriate to the printable content. The default is UIPrintInfoOutputGeneral. See the descriptions of the UIPrintInfoOutputType constants for more information.
The output type controls the quality and default paper size used in printing. For example, if your application only prints black text, setting this property to UIPrintInfoOutputGrayscale can result in better performance in many cases. See UIPrintPaper Class Reference for details.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.hprinterID
An identifier of the printer to use for the print job.
Discussion
This property is set through user selection in the printing user interface. You may provide a printer ID as a hint (for example, the last printer used from a particular print job). The default value is nil.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.hClass Methods
printInfo
Returns a print-information object initialized with default values.
Return Value
An instance of UIPrintInfo or nil if the object could not be created.
Availability
- Available in iOS 4.2 and later.
See Also
Declared In
UIPrintInfo.hprintInfoWithDictionary:
Returns a print-information object that is initialized with the data in the passed-in dictionary.
Parameters
- dictionary
A dictionary that contains data to initialize the
UIPrintInfoobject with.
Return Value
An instance of UIPrintInfo or nil if the object could not be created.
Discussion
You use the dictionary parameter to initialize a UIPrintInfo object with stored print-job information. Some applications might archive a previous UIPrintInfo object and use that for a future print job with this method.
You can later access the dictionary by calling the dictionaryRepresentation method on the UIPrintInfo object.
Availability
- Available in iOS 4.2 and later.
See Also
Declared In
UIPrintInfo.hInstance Methods
dictionaryRepresentation
Returns a dictionary representation of a print-information object.
Return Value
A dictionary representation of a UIPrintInfo object that can be archived and used to create a new UIPrintInfo object. Returns nil if no dictionary can be created.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.hConstants
UIPrintInfoDuplex
The duplex mode of a selected printer.
typedef enum {
UIPrintInfoDuplexNone,
UIPrintInfoDuplexLongEdge,
UIPrintInfoDuplexShortEdge,
} UIPrintInfoDuplex;
Constants
UIPrintInfoDuplexNoneNo double-sided (duplex) printing; single-sided printing only.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.UIPrintInfoDuplexLongEdgeDuplex printing that flips the back page along the long edge of the paper.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.UIPrintInfoDuplexShortEdgeDuplex print that flips the back page along the short edge of the paper.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.
Discussion
You use these constants when setting the value of the duplex property of a UIPrintInfo object.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.hUIPrintInfoOrientation
The orientation of printing on a page.
typedef enum {
UIPrintInfoOrientationPortrait,
UIPrintInfoOrientationLandscape,
} UIPrintInfoOrientation;
Constants
UIPrintInfoOrientationPortraitPages are printed in portrait orientation.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.UIPrintInfoOrientationLandscapePages are printed in landscape orientation.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.
Discussion
You use these constants when setting the value of the orientation property of a UIPrintInfo object.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.hUIPrintInfoOutputType
The output type, which is an indication of the type of content the application is drawing or providing.
typedef enum { UIPrintInfoOutputGeneral, UIPrintInfoOutputPhoto, UIPrintInfoOutputGrayscale, } UIPrintInfoOutputType;
Constants
UIPrintInfoOutputGeneralSpecifies that the printed content consists of mixed text, graphics, and images. The default paper is Letter, A4, or similar locale-specific designation. Output is normal quality, duplex.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.UIPrintInfoOutputPhotoSpecifies that the printed content consists of black-and-white or color images. The default paper is 4x6, A6, or similar locale-specific designation. Output is high quality, simplex.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.UIPrintInfoOutputGrayscaleSpecifies that the printed content is grayscale. Set the output type to this value when your printable content contains no color—for example, it’s black text only. The default paper is Letter/A4. Output is grayscale quality, duplex. This content type can produce a performance improvement in some cases.
Available in iOS 4.2 and later.
Declared in
UIPrintInfo.h.
Discussion
You use these constants when setting the value of the outputType property of a UIPrintInfo object.
Availability
- Available in iOS 4.2 and later.
Declared In
UIPrintInfo.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-10-12)