是否从ios应用程序通过蓝牙打印机打印?

是否从ios应用程序通过蓝牙打印机打印?,ios,xcode,printing,bluetooth,Ios,Xcode,Printing,Bluetooth,从我的应用程序通过蓝牙打印机打印照片 打印机已通过蓝牙连接 当我点击ui按钮并打印连接到手机的照片时 我该怎么做?iOS不支持通过蓝牙打印。它支持通过AirPrint使用WiFi打印 - (void)callPrintPDF { UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; UIPrintInteractionController *pic =

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

打印机已通过蓝牙连接

当我点击ui按钮并打印连接到手机的照片时


我该怎么做?

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

- (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];
}
支持的AirPrinter列表。

下面是一个使用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];
}

给我一些例子链接,直接从中学习,你自己没有做的原因是。。。。?