• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Custom pagination clipping
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: warning: type `string' has a user-defined constructor
  • Next by Date: Re: resetting ivars safely
  • Previous by thread: Re: resetting ivars safely
  • Next by thread: Re: Custom pagination clipping
  • Index(es):
    • Date
    • Thread