Iphone 打印图像及其下方的文本,然后从右向左打印

Iphone 打印图像及其下方的文本,然后从右向左打印,iphone,objective-c,ipad,printing,airprint,Iphone,Objective C,Ipad,Printing,Airprint,我知道如何仅使用nsdata打印图像 我还知道只使用UISimpleTextPrintFormatter打印文本 问题是,我想打印一个图像和它下面的文本 我怎样才能做到这一点 如何从右坐标开始打印而不是从左坐标开始打印 NSMutableString *printBody = [NSMutableString stringWithFormat:@"some text"]; UIPrintInteractionController *pic = [UIPrintInteractionControl

我知道如何仅使用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];

谢谢

我不太清楚你的意思,但这有帮助吗

// Setup Title
    theTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 20)];
    [self.view addSubview:theTitle];

Where
initWithFrame:CGRectMake(,)
告诉标题放置的位置及其大小?

我不太清楚您的意思,但这有帮助吗

// Setup Title
    theTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 20)];
    [self.view addSubview:theTitle];

其中
initWithFrame:CGRectMake(,)
告诉标题放置位置及其大小?

我希望打印的页面对齐方式从右到左开始,就像将文本对齐方式设置为右时一样。我希望文本格式化程序绘制在页面的右侧。我认为,如果我使用它的宽度并将其文本对齐方式设置为右,我将得到所需的内容,但问题是我不知道如何设置它的宽度,我不能将文本对齐方式设置为右侧我希望打印的页面对齐方式从右向左开始,就像将文本对齐方式设置为右侧一样我希望文本格式化程序绘制在页面的右侧我想如果我使用它的宽度并将其文本对齐方式设置为右侧我会得到我需要的,但问题是我不知道如何设置它的宽度,我不能设置文本对齐的权利