iPad printing orientation problem
I have an printing problem in my ipad app. The view which I want to print is in landscape mode, I want to print it in the portrait mode.
I have HP B110A printer which supports AirPrint
Following is my code for printing
NSData *dataFromPath = [NSData dataWithContentsOfFile:filePath];
UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController];
if(printController && [UIPrintInteractionController canPrintData:dataFromPath]) {
printController.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [filePath lastPathComponent];
printInfo.duplex = UIPrintInfoDuplexNone;
p开发者_如何学CrintInfo.orientation = UIPrintInfoOrientationPortrait;
printController.printInfo = printInfo;
printController.printingItem = dataFromPath;
[printController presentAnimated:YES completionHandler:completionHandler];
//and some handler code here
}
Now, even when I have set the print orientation as Portrait the print is appearing in landscape mode.
PS: My app is set to work in landscape mode only.
精彩评论