Skip to content

Instantly share code, notes, and snippets.

@wanderwaltz
Created March 30, 2013 06:45
Show Gist options
  • Save wanderwaltz/5275665 to your computer and use it in GitHub Desktop.
Save wanderwaltz/5275665 to your computer and use it in GitHub Desktop.
Print contents of an UIWebView
UIPrintInteractionController *controller =
[UIPrintInteractionController sharedPrintController];
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
controller.printInfo = printInfo;
controller.printFormatter = [_webView viewPrintFormatter];
controller.showsPageRange = YES;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error)
{
};
[controller presentAnimated: YES
completionHandler: completionHandler];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment