2

I want to add AirPrint functionality to my iPad application

I have been trying to display printer ontions described in Apple's Drawing and Printing Guide

I have toolbar and UIBarButtonItem *printButton. In controller I receive onPrintClick and try to display printer options by such code:

UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
 [controller setDelegate:self];
 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  [controller presentFromBarButtonItem:self.printButton animated:YES
         completionHandler:completionHandler];
 } else {
  [controller presentAnimated:YES completionHandler:nil];
 }

Please help, because I do receive nothing :(

yuji
  • 16,695
  • 4
  • 63
  • 64
Serg
  • 21
  • 1
  • 2

2 Answers2

1

You need to set printItem/printItems property in order to use an AirPrint.

controller.printItem = a URL to PDF or image file;
iwat
  • 3,591
  • 2
  • 20
  • 24
0

I've used this personally on an iPad app: Including AirPrint on an iOS App

user293895
  • 1,465
  • 3
  • 22
  • 39