iOS Developer Library

Developer

UIKit Framework Reference UIPrintInfo Class Reference

Options
Deployment Target:

On This Page
Language:

UIPrintInfo

Inherits From


Conforms To


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 4.2 and later

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.

  • Returns a print-information object initialized with default values.

    Declaration

    Swift

    class func printInfo() -> UIPrintInfo!

    Objective-C

    + (UIPrintInfo *)printInfo

    Return Value

    An instance of UIPrintInfo or nil if the object could not be created.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • Returns a print-information object that is initialized with the data in the passed-in dictionary.

    Declaration

    Swift

    init!(dictionary dictionary: [NSObject : AnyObject]?) -> UIPrintInfo

    Objective-C

    + (UIPrintInfo *)printInfoWithDictionary:(NSDictionary *)dictionary

    Parameters

    dictionary

    A dictionary that contains data to initialize the UIPrintInfo object 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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

    See Also

    + printInfo

  • Returns a dictionary representation of a print-information object.

    Declaration

    Swift

    func dictionaryRepresentation() -> [NSObject : AnyObject]?

    Objective-C

    - (NSDictionary *)dictionaryRepresentation

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • duplex duplex Property

    Specifies the duplex mode to use for the print job.

    Declaration

    Swift

    var duplex: UIPrintInfoDuplex

    Objective-C

    @property(nonatomic) UIPrintInfoDuplex duplex

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • jobName jobName Property

    The name of the print job.

    Declaration

    Swift

    var jobName: String!

    Objective-C

    @property(nonatomic, copy) NSString *jobName

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • The orientation of the printed content, portrait or landscape.

    Declaration

    Swift

    var orientation: UIPrintInfoOrientation

    Objective-C

    @property(nonatomic) UIPrintInfoOrientation orientation

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • The kind of printable content.

    Declaration

    Swift

    var outputType: UIPrintInfoOutputType

    Objective-C

    @property(nonatomic) UIPrintInfoOutputType outputType

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • printerID printerID Property

    An identifier of the printer to use for the print job.

    Declaration

    Swift

    var printerID: String?

    Objective-C

    @property(nonatomic, copy) NSString *printerID

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

Data Types

  • The duplex mode of a selected printer.

    Declaration

    Swift

    enum UIPrintInfoDuplex : Int { case None case LongEdge case ShortEdge }

    Objective-C

    typedef enum { UIPrintInfoDuplexNone, UIPrintInfoDuplexLongEdge, UIPrintInfoDuplexShortEdge, } UIPrintInfoDuplex;

    Constants

    • None

      UIPrintInfoDuplexNone

      No double-sided (duplex) printing; single-sided printing only.

      Available in iOS 4.2 and later

    • LongEdge

      UIPrintInfoDuplexLongEdge

      Duplex printing that flips the back page along the long edge of the paper.

      Available in iOS 4.2 and later

    • ShortEdge

      UIPrintInfoDuplexShortEdge

      Duplex print that flips the back page along the short edge of the paper.

      Available in iOS 4.2 and later

    Discussion

    You use these constants when setting the value of the duplex property of a UIPrintInfo object.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • The orientation of printing on a page.

    Declaration

    Swift

    enum UIPrintInfoOrientation : Int { case Portrait case Landscape }

    Objective-C

    typedef enum { UIPrintInfoOrientationPortrait, UIPrintInfoOrientationLandscape, } UIPrintInfoOrientation;

    Constants

    • Portrait

      UIPrintInfoOrientationPortrait

      Pages are printed in portrait orientation.

      Available in iOS 4.2 and later

    • Landscape

      UIPrintInfoOrientationLandscape

      Pages are printed in landscape orientation.

      Available in iOS 4.2 and later

    Discussion

    You use these constants when setting the value of the orientation property of a UIPrintInfo object.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later

  • The output type, which is an indication of the type of content the application is drawing or providing.

    Declaration

    Swift

    enum UIPrintInfoOutputType : Int { case General case Photo case Grayscale case PhotoGrayscale }

    Objective-C

    typedef enum { UIPrintInfoOutputGeneral, UIPrintInfoOutputPhoto, UIPrintInfoOutputGrayscale, UIPrintInfoOutputPhotoGrayscale } UIPrintInfoOutputType;

    Constants

    • General

      UIPrintInfoOutputGeneral

      Specifies 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

    • Photo

      UIPrintInfoOutputPhoto

      Specifies 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

    • Grayscale

      UIPrintInfoOutputGrayscale

      Specifies 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

    • PhotoGrayscale

      UIPrintInfoOutputPhotoGrayscale

      Specifies that the printed content is a grayscale image. 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 high quality grayscale, duplex.

      Available in iOS 7.0 and later

    Discussion

    You use these constants when setting the value of the outputType property of a UIPrintInfo object.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later