UIPrintInteractionController 使用要打印的数据。如果我想从 imageview 打印图像,它会给我一些警告。我想使用 imageview 中的图像而不是资源中的图像。我想知道如何从 ImageView 中的图像中获取数据
UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController];
NSData * datatobeprinted [NSData dataWithContentsOfFile:imageView.image];
if(printController && [UIPrintInteractionController canPrintData:imageView.image]) {
printController.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [path lastPathComponent];
printInfo.duplex = UIPrintInfoDuplexLongEdge;
printController.printInfo = printInfo;
printController.showsPageRange = YES;
[printController setPrintingItem:datatobeprinted];
}