0
votes

I have an enterprise iPad app which is running inside my company. I'm using AirPrint inside the application and I have several air printers inside my WIFI network.

I need to set a default printer for some user groups and restrict the other all printers. (No need to show in the printer list)

Does anybody know how to do this? I see a printerId property in UIPrintInfo. May be i can use this. Not sure.

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.
2

2 Answers

1
votes

Official reply from the Apple I received is as follows.

There's no way to do this with the current iOS printing system. Please feel welcome to file a bug report although I cannot say we'll provide such a mechanism in a future iOS version.

-1
votes

You could try this (not tested) :

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