2012-10-24 91 views
0

我有一个企业iPad应用程序正在我的公司内部运行。我在应用程序内部使用AirPrint,我的WIFI网络中有几台空气打印机。iOS AirPrint-设置默认打印机

我需要为某些用户组设置默认打印机,并限制其他所有打印机。 (不需要在打印机列表中显示)

有没有人知道如何做到这一点?我在UIPrintInfo中看到了一个printerId属性。可能是我可以使用这个。不确定。

printerID 
An identifier of the printer to use for the print job. 

@property(nonatomic, copy) NSString *printerID 
Discussion 
This property is set through user selection in the printing user interface. You may provide a printer ID as a hint (for example, the last printer used from a particular print job). The default value is nil. 

回答

1

批复如下。

用当前的iOS打印系统无法做到这一点。尽管我不能说我们将在未来的iOS版本中提供这样的机制,但请您感到欢迎提交错误报告。

-1

你可以试试这个(未测试):从Apple我收到

- (IBAction)printContent:(id)sender { 

    UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; 

    if (pic && [UIPrintInteractionController canPrintData: self.myPDFData]) { 

     pic.delegate = self; 

     UIPrintInfo *printInfo = [UIPrintInfo printInfo]; 
     printInfo.outputType = UIPrintInfoOutputGeneral; 
     printInfo.jobName = [self.path lastPathComponent]; 
     printInfo.duplex = UIPrintInfoDuplexLongEdge; 

     //Set the printer ID you want to use 
     printInfo.printerID = thePrinterIDYouWant; 

     //Set the printInfo to the pritnController 
     pic.printInfo = printInfo; 

     //Enhance the print here 
    } 
} 
+0

这是设置默认打印机还是隐藏其他打印机? –

相关问题