Printing Text

Printing text is probably the most common use case for not just AirPrint but any kind of print job. Using AirPrint to print text can be complex if you aren’t familiar with printing terminology. The following code is from the ICFFirstViewController.m class of the sample app. Look at it as a whole first; later in this section, it will be broken down by each line and discussed.

- (IBAction)print:(id)sender{    UIPrintInteractionController *print = [UIPrintInteractionController sharedPrintController];    print.delegate = self;    UIPrintInfo *printInfo = [UIPrintInfo printInfo];    printInfo.outputType = UIPrintInfoOutputGeneral;    printInfo.jobName = @"Print for iOS";    printInfo.duplex = UIPrintInfoDuplexLongEdge ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.