Custom pagination clipping
Custom pagination clipping
- Subject: Custom pagination clipping
- From: Greg Hoover <email@hidden>
- Date: Wed, 12 Sep 2007 14:14:38 -0700
I have an NSTextView that I'm trying to paginate so that lines aren't
cut when printing across several pages. In knowsPageRange I figure
out where the page boundaries should be in the view's coordinate
system. Then I've overridden rectForPage as follows:
- (NSRect)rectForPage:(int)pageNumber {
NSRect rect = [self bounds];
if ([pageBoundaries count]) {
rect.origin.y = 0;
if (pageNumber > 1)
rect.origin.y = [[pageBoundaries objectAtIndex: pageNumber - 2]
floatValue];
rect.size.height = [[pageBoundaries objectAtIndex: pageNumber - 1]
floatValue] - rect.origin.y;
}
return rect;
}
The problem is that the view is wider than the printed page and it
gets clipped. I'd hoped that the rect I return from rectFromPage
would be scaled to fit the printed area, but apparently not. The
default printing from NSVIew handles this scaling great. Can someone
fill in what I'm missing?
Thanks,
Greg
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden