In my app, different photo sizes can be printed. This is working fine, but with iOS 8 the paper size is always letter/A4 even if the print dialog display e.g.. 5"x7". If the user selects the paper size again, the paper size changes to e.g. 5"x7".
Does anybody have the same problem?
Is there a workaround?
Here is the code:
- (UIPrintPaper *)printInteractionController:(UIPrintInteractionController *)printInteractionController choosePaper:(NSArray *)paperList
{
CGSize PageSize = ((PPPage *)[document.pages objectAtIndex:0]).paperSize;
if (PageSize.width > PageSize.height) {
float w = PageSize.width;
PageSize.width = PageSize.height;
PageSize.height = w;
}
NSLog(@"printInteractionController:choosePaper: Needed Pagesize = (%.1f,%.1f)",PageSize.width,PageSize.height);
UIPrintPaper *retPaper = [UIPrintPaper bestPaperForPageSize:PageSize withPapersFromArray:paperList];
NSLog(@"printInteractionController:choosePaper: chosen UIPrintPaper = (%.1f,%.1f)",retPaper.paperSize.width,retPaper.paperSize.height);
return retPaper;
}
And the log output:
2015-06-19 12:22:53.474 PhotoPrint[5955:1225053] printInteractionController:choosePaper: Needed Pagesize = (288.0,432.0) 2015-06-19 12:22:54.118 PhotoPrint[5955:1225053] printInteractionController:choosePaper: chosen UIPrintPaper = (612.0,792.0) 2015-06-19 12:22:54.118 PhotoPrint[5955:1225053] -[PKPaperList matchedPaper:preferBorderless:withDuplexMode:didMatch:] paperToMatch= result= matchType=0 2015-06-19 12:23:06.351 PhotoPrint[5955:1225053]
--> wrong paper size letter selected!
Now select the paper again:
printInteractionController:choosePaper: Needed Pagesize = (288.0,432.0) 2015-06-19 12:23:14.860 PhotoPrint[5955:1225053] printInteractionController:choosePaper: chosen UIPrintPaper = (360.0,504.0) 2015-06-19 12:23:14.860 PhotoPrint[5955:1225053] -[PKPaperList matchedPaper:preferBorderless:withDuplexMode:didMatch:] paperToMatch= result= matchType=0
--> this time correct paper size.