Instance Property

printingItem

A single ready-to-print object.

Declaration

var printingItem: Any? { get set }

Discussion

The object must be an instance of the NSURL, NSData, UIImage, or ALAsset class. An object of the first two types must reference or contain image data or PDF data. NSURL objects must use the file: or assets-library: scheme or any scheme that can return an NSData object with a registered protocol. Image data (including that encapsulated by UIImage an ALAsset objects) must be in a format supported by the Image I/O framework; see Figure 2 in UIImage for more information. An ALAsset object must be of type ALAssetTypePhoto. The object is released at the end of the print job. The default value is nil.

If you set this property, UIPrintInteractionController sets the printingItems, printPageRenderer, and printFormatter properties to nil. (Only one of these properties can be set for a print job.)

If this property is set and the showsPageRange property is set to true—and the printing item is a PDF document of more than one page—the printing options include the control for selecting a page range.

See Also

Providing the Source of Printable Content

var printingItems: [Any]?

An array of ready-to-print objects.

var printPageRenderer: UIPrintPageRenderer?

An object that draws pages of printable content when requested by UIKit.

var printFormatter: UIPrintFormatter?

An object that lays out the content of pages based on the kind of content.