我知道如何仅使用 nsdata 打印图像
而且我也知道仅使用 UISimpleTextPrintFormatter 打印文本
问题是我想打印一张图片和它下面的文字
我怎样才能做到这一点?
以及如何从右坐标而不是左坐标开始打印?
NSMutableString *printBody = [NSMutableString stringWithFormat:@"some text"];
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
pic.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"print";
pic.printInfo = printInfo;
UISimpleTextPrintFormatter *textFormatter = [[UISimpleTextPrintFormatter alloc] initWithText:printBody];
textFormatter.startPage = 0;
textFormatter.font=[UIFont fontWithName:@"Arail Bold" size:40];
textFormatter.contentInsets = UIEdgeInsetsMake(216.0, 288.0, 72.0, 72.0);
textFormatter.maximumContentWidth = 6 * 72.0;
textFormatter.textAlignment=UITextAlignmentRight;
textFormatter.font=[UIFont fontWithName:@"Arail Bold" size:40];
pic.printFormatter = textFormatter;
pic.showsPageRange = YES;
[pic presentAnimated:YES completionHandler:NULL];
[textFormatter release];
谢谢你