从我的ios应用程序通过蓝牙打印机打印?

时间:2015-02-05 11:01:02

标签: ios xcode printing bluetooth

从我的应用程序通过蓝牙打印机打印照片。

打印机已通过蓝牙连接。

当我点击UIButton并打印机打印连接到手机的照片时。

我该怎么做?

1 个答案:

答案 0 :(得分:-1)

iOS不支持通过蓝牙打印。它支持通过AirPrint使用WiFi进行打印。

支持的AirPrinters列表。 http://support.apple.com/kb/HT4356

以下是使用AirPrint打印PDF的示例。

- (void)callPrintPDF {
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
pic.delegate = self;
pic.printInfo = printInfo;
NSURL *url = [NSURL URLWithString:self.strPDFUrl];
pic.printingItem = url;

void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
    ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
    if (!completed && error) {
        NSLog(@"Printing could not complete because of error: %@", error);
    }
};
[pic presentAnimated:YES completionHandler:completionHandler];
}
相关问题