Source
Accidentally playing a demo found that the printer was called to discover that iOS has the ability to quickly call the printer.
1 if([uiprintinteractioncontroller isprintingavailable] = =YES)2 {3Nsurl *fileurl = Document.fileurl;//Document file URL4 5 if([uiprintinteractioncontroller canprinturl:fileurl] = =YES)6 {7Printinteraction =[Uiprintinteractioncontroller Sharedprintcontroller];8 9Uiprintinfo *printinfo =[Uiprintinfo Printinfo];TenPrintinfo.duplex =Uiprintinfoduplexlongedge; OnePrintinfo.outputtype =uiprintinfooutputgeneral; APrintinfo.jobname =Document.filename; - -Printinteraction.printinfo =Printinfo; thePrintinteraction.printingitem =FileURL; -Printinteraction.showspagerange =YES; - - if(Userinterfaceidiom = = Uiuserinterfaceidiompad)//Large Device Printing + { - [printinteraction presentFromRect:button.bounds inview:button animated:yes completionhandler: +^ (Uiprintinteractioncontroller *pic, BOOL completed, Nserror *error) A { at #ifdefDEBUG - if((completed = = NO) && (Error! = nil)) NSLog (@"%s%@", __function__, error); - #endif - } - ]; - } in Else //Handle Printing on small device - { to [printinteraction presentanimated:yes Completionhandler: +^ (Uiprintinteractioncontroller *pic, BOOL completed, Nserror *error) - { the #ifdefDEBUG * if((completed = = NO) && (Error! = nil)) NSLog (@"%s%@", __function__, error); $ #endifPanax Notoginseng } - ]; the } + } A}
iOS Call printer