Objective c 以编程方式从ipad向wifi打印机发送数据
我正在创建一个ipad应用程序,希望通过编程将数据发送到wifi打印机。是否有任何API或示例代码可用于实现此目的Objective c 以编程方式从ipad向wifi打印机发送数据,objective-c,ipad,ios5,wifi,printers,Objective C,Ipad,Ios5,Wifi,Printers,我正在创建一个ipad应用程序,希望通过编程将数据发送到wifi打印机。是否有任何API或示例代码可用于实现此目的 谢谢。我认为使用AirPrint,普通的打印API可以实现这一点 此外,还有一个很棒的应用程序叫做Printopia,它可以让你的Mac电脑充当AirPrint主机:我认为普通的打印API可以通过使用AirPrint实现这一点 此外,还有一个名为Printopia的很棒的应用程序,可以让你的Mac电脑充当AirPrint主机:UIPrintInteractionController
谢谢。我认为使用AirPrint,普通的打印API可以实现这一点
此外,还有一个很棒的应用程序叫做Printopia,它可以让你的Mac电脑充当AirPrint主机:我认为普通的打印API可以通过使用AirPrint实现这一点
此外,还有一个名为Printopia的很棒的应用程序,可以让你的Mac电脑充当AirPrint主机:UIPrintInteractionController*pic=[UIPrintInteractionController sharedPrintController] if(pic&[UIPrintInteractionController canPrintData:self.myPDFData]){
}UIPrintInteractionController*pic=[UIPrintInteractionController sharedPrintController] if(pic&[UIPrintInteractionController canPrintData:self.myPDFData]){
}取决于您要使用的打印机型号。取决于您要使用的打印机型号。
pic.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"PrintPdf";
printInfo.duplex = UIPrintInfoDuplexLongEdge;
pic.printInfo = printInfo;
pic.showsPageRange = YES;
pic.printingItem = self.myPDFData;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
if (!completed && error)
NSLog(@"FAILED! due to error in domain %@ with error code %ld",
error.domain, (long)error.code);
};
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[pic presentFromRect:self.printButton.frame inView:self.view animated:YES completionHandler:^(UIPrintInteractionController *printInteractionController, BOOL completed, NSError *error) {
}];
} else {
[pic presentAnimated:YES completionHandler:completionHandler];
}