Apple has print documentation that is likely to benefit you.
The following is the Objective-C code for AirPrint :
Check print availability:
if ([UIPrintInteractionController isPrintingAvailable]) { // Available } else { // Not Available }
Printing after pressing a button:
-(IBAction) buttonClicked: (id) sender; { NSMutableString *printBody = [NSMutableString stringWithFormat:@"%@, %@",self.encoded.text, self.decoded.text]; [printBody appendFormat:@"\n\n\n\nPrinted From *myapp*"]; UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; pic.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.jobName = self.titleLabel.text; pic.printInfo = printInfo; UISimpleTextPrintFormatter *textFormatter = [[UISimpleTextPrintFormatter alloc] initWithText:printBody]; textFormatter.startPage = 0; textFormatter.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0);
source share