开发者

Unable to display printer options with AirPrint

开发者 https://www.devze.com 2023-01-27 02:28 出处:网络
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 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 :(


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

controller.printItem = a URL to PDF or image file;


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号