小编moy*_*dos的帖子

使用UIPrintInteractionController打印PDF ios 5可以工作,但在ios 6中不起作用并使我的应用程序崩溃

我有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)

iphone objective-c airprint ios6

6
推荐指数
1
解决办法
1936
查看次数

标签 统计

airprint ×1

ios6 ×1

iphone ×1

objective-c ×1