79781757

Date: 2025-10-03 12:18:06
Score: 2
Natty:
Report link

Five years later, and I've been having similar problems trying to get a printInfo with a correct '-imageablePageBounds' Rect for A4 paper. In my case the incorrect y-offset is 41 when it should be 12. The good news is I've found a workaround:

NSPrintInfo *printInfo = [[NSPrintInfo sharedPrintInfo] copy]; // autorelease later
    NSLog(@"As-received copy of sharedPrintInfo:");
    NSLog(@"   paperSize = %@", NSStringFromSize([printInfo paperSize]));
    NSLog(@"   imageablePageBounds = %@", NSStringFromRect([printInfo imageablePageBounds]));
    [printInfo setPaperSize:[printInfo paperSize]];
    NSLog(@"After [printInfo setPaperSize:[printInfo paperSize]]:");
    NSLog(@"   paperSize = %@", NSStringFromSize([printInfo paperSize]));
    NSLog(@"   imageablePageBounds = %@", NSStringFromRect([printInfo imageablePageBounds]));

and the 'noop' reset of the paperSize seems to trigger a recalculation of the -imageablePageBounds value:

As-received copy of sharedPrintInfo:
   paperSize =  {595, 842}
   imageablePageBounds =  {{18, 41}, {559, 783}}
After [printInfo setPaperSize:[printInfo paperSize]]:
   paperSize =  {595, 842}
   imageablePageBounds =  {{18, 12}, {559, 818}}

I've only tested this on Tahoe but I think it proves it's a macOS bug so I'll try reporting it again.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): having similar problem
  • Low reputation (1):
Posted by: Chuck