我正在UIImage
使用 AirPrint 打印,但边距不正确。这是打印时的样子:
有没有办法让它完美地贴合在纸上?
这是所要求的代码:
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
//pic.delegate = del;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [NSString stringWithFormat:@"New Ticket"];
pic.printInfo = printInfo;
pic.printingItem = [UIImage imageWithContentsOfFile:path];
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if (!completed && error) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Error."
message:[NSString stringWithFormat:@"An error occured while printing: %@", error]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil];
[av show];
[av release];
}
};
[pic presentAnimated:YES completionHandler:completionHandler];