2015-02-05 2 views
0

Печать фото через принтер Bluetooth из моего приложения.Печать через принтер bluetooth из приложения ios?

Принтер уже подключен через bluetooth.

Когда я нажимаю на UIButton и принтер, распечатайте фотографию, подключенную к телефону.

Как я могу это сделать?

+0

https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/index.html – user523234

+0

Дайте мне пример ссылки, чтобы узнать от непосредственно – MAC113

+0

И причина, почему вы не сделал это сам ....? – user523234

ответ

-1

iOS не поддерживает печать через bluetooth. Он поддерживает печать через WiFi через AirPrint.

Список поддерживаемых AirPrinters. http://support.apple.com/kb/HT4356

Вот пример для печати PDF с использованием AirPrint.

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