I have just implemented custom pagination by overriding the -(BOOL)knowsPageRange: and -(NSRect)rectForPage: methods.
These are printing the correct areas of my NSView, however, the printed
output is always scaled to 100%, whereas I require to set the scale to
something larger. Each of my custom pages are less than A4 size, but I want that each custom page will be printed to the whole A4 paper with scaling.
To do scaling I applied CGAffineTransformScale to the current graphics context during printing. Scaling works properly but clipping to the rect from rectForPage occurs.
Set the view’s frame to the size it would be when scaling is in effect. Then compute
rectForPage:accordingly, with the scale taken into effect.