Printing Rendered HTML

Printing rendered HTML is handled automatically through a print formatter in an almost identical manner as printing plain text. The following method handles printing an HTML string, which is retrieved from the UIWebView in the sample app. You might notice that this is similar to how text was printed in the previous example. Take a look at the method as a whole; it is discussed in detail later in this section.

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

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.