【问题标题】:Unable to display printer options with AirPrint无法使用 AirPrint 显示打印机选项
【发布时间】:2010-11-25 09:47:13
【问题描述】:

我想将 AirPrint 功能添加到我的 iPad 应用程序

我一直在尝试显示 Apple 的 Drawing and Printing Guide 中描述的打印机选项

我有工具栏和UIBarButtonItem *printButton。在控制器中,我收到onPrintClick 并尝试通过此类代码显示打印机选项:

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];
 }

请帮忙,因为我什么也没收到:(

【问题讨论】:

    标签: iphone ipad ios-4.2 airprint


    【解决方案1】:

    您需要设置printItem/printItems 属性才能使用AirPrint。

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

    【讨论】:

      【解决方案2】:

      我个人在 iPad 应用上使用过这个:Including AirPrint on an iOS App

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-03
        • 1970-01-01
        • 1970-01-01
        • 2021-09-27
        • 2018-01-24
        相关资源
        最近更新 更多