FROM : John Nairn
DATE : Tue Jul 01 22:53:04 2008
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
DATE : Tue Jul 01 22:53:04 2008
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
| Related mails | Author | Date |
|---|---|---|
| John Nairn | Jun 30, 23:44 | |
| Scott Ribe | Jul 1, 19:29 | |
| John Nairn | Jul 1, 22:53 | |
| Scott Ribe | Jul 1, 23:41 |






Cocoa mail archive

