• 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
Re: Scaled Printing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scaled Printing


  • Subject: Re: Scaled Printing
  • From: John Nairn <email@hidden>
  • Date: Tue, 1 Jul 2008 13:53:04 -0700


On Jul 1, 2008, at 10:29 AM, Scott Ribe wrote:

but the view
always prints at 100% and thus scaling does not print correctly

Yeah, you're dividing by the scaling factor, thus negating the scaling. IOW,
user wants to print at 0.75, you divide by 0.75 thus scaling your own page
area *up*, then the printing system multiplies by 0.75, and there you have
it: drawing at 1.0.

But, I got that from sample code in the "Printing" topic of the Apple's cocoa documentation?


Nevertheless, I tried not dividing by the scaling and it still draws at 100%. Furthermore it calculated the number of pages incorrectly. For example, I had one printing that spanned 2 pages in horizontal direction and 2 pages in vertical direction. Printing at 50% should fit it all on to one page. If I remove the divide by scaling, the knowsPageRange method always returns 4 pages and does not change when the scaling changes?

So I tried a different approach and have it solved (an unsatisfying solution, however, in that I still don't know why the other way failed).

Instead of overriding knowsPageRange and rectForPage, I overrode

- (void)adjustPageHeightNew:(float *)newBottom top:(float)top bottom: (float)proposedBottom limit:(float)bottomLimit
{ *newBottom=proposedBottom
}


and similarly for width. This uses the initial proposed setting, which came from my margin settings, while the default method would check all subviews and usually move the page break. I wanted to fill the paper even if it meant going through subviews and this change solved that problem. This way scales correctly as well.

---------------
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://woodscience.oregonstate.edu/faculty/Nairn
FEA/MPM Web Page: http://oregonstate.edu/~nairnj



_______________________________________________

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


  • Follow-Ups:
    • Re: Scaled Printing
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Scaled Printing (From: Scott Ribe <email@hidden>)

  • Prev by Date: KVO Bug With Keypaths
  • Next by Date: Re: KVO Bug With Keypaths
  • Previous by thread: Re: Scaled Printing
  • Next by thread: Re: Scaled Printing
  • Index(es):
    • Date
    • Thread