Thursday, 15 May 2014

iphone - Printing a PDF with UIPrintInteractionController ios 5 works but in ios 6 doesnt work and crash my app -


I print a problem with UIPrintInteractionController to a device with iOS 5 I send a PDF when I press is sending the print button file printer and work, but when I iOS would test a device with 6 I> p app does not work and crash

  Save \ 032in \ 032folder \ 032Aptana \ 032Rubles._ipp._tcp.local. Go: -Printer-Properties Failed: Undefined Error: 0 No document-format-supported attribute was found or no supported format was found. No media-call-database was found in response to the printer. Deciding the values ​​of the generic media size did not get any print-quality-supported feature, no outstanding-supported attributes were found for general quality. Set single-sided   

Here is my code: (self.myPDF a NMutableSData type)

  UIPrintInteractionController * controller = [UIPrintInteractionController sharedPrintController]; If (controller & amp; & amp; [UIPrintInteractionController canPrintData: self.myPDF]) {UIPrintInfo * printInfo = [UIPrintInfo printInfo]; PrintInfo.outputType = UIPrintInfoOutputGeneral; PrintInfo.jobName = [NSString stringWithFormat: @ "coupon"]; PrintInfo.orientation = UIPrintInfoOrientationPortrait; PrintInfo.duplex = UIPrintInfoDuplexLongEdge; Controller.printinfo = printinfo; Controller Showzarenz = No; Controller Printing ITAM = Self MIPDF; Zero (^ completionHandler) (UIPrintInteractionController *, bool, NSError *) = ^ (UIPrintInteractionController * printController, BOOL complete, NSError * error) {if (Full & amp ;! & amp; error) {UIAlertView * av = [[UIAlertView alloc ] InitWithTitle: @ "Error." Message: [NSString stringWithFormat: NSLocalizedString (@ "An error occurred while printing:% @", @ "typographical error"), error] representatives: cancelButtonTitle zero: @ "OK" OtherButtonTitles: zero, zero]; [Avi show]; [Avi release]; }}; [Controller present permission: Yes complete handler: complete handler]; }   

I do not have an airprint-supported printer, but I have used this easy print. Note: Printing works with Safari using the elephant print on iOS 6.

Does anyone know what is wrong? = (

Test it with an airprint printer simulator that comes with XPPix. May be easy print does not support new features in AirPrint.

No comments:

Post a Comment