我有UIPrintInteractionController的问题我发送pdf打印和使用带有ios 5的设备当我按下打印按钮将文件发送到打印机并工作.但是当我在带有ios 6的设备上测试时,我无法工作并使应用程序崩溃.
当ios 6上显示UIPrintInteractionController的视图时,这是日志:
Save\032in\032folder\032Aptana\032Rubles._ipp._tcp.local.:
Get-Printer-Attributes failed: Undefined error: 0
No document-format-supported attribute found or no supported formats
found.
No media-col-database found in response from printer.
Defaulting to generic media size values.
No print-quality-supported attribute found. Defaulting to normal
quality.
No sides-supported attribute found. Defaulting to single-sided.
Run Code Online (Sandbox Code Playgroud)
这是我的代码:(self.myPDF是一个NMutableSData类型)
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
if (controller && [UIPrintInteractionController canPrintData: self.myPDF] ) {
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [NSString stringWithFormat:@"Coupon"];
printInfo.orientation = UIPrintInfoOrientationPortrait;
printInfo.duplex = UIPrintInfoDuplexLongEdge; …Run Code Online (Sandbox Code Playgroud)