Skip navigation.
 
mlIs it acceptable to use -knowsPageRange to generate page rects?
FROM : Paul Bruneau
DATE : Thu Nov 29 20:30:02 2007

Hi-

In the continuing saga of my production scheduling program (which has 
benefited so much from the kind help of this list), I am currently 
implementing printing of production schedules with custom pagination. 
I have a list of work centers each with order steps that must appear 
on the printout. Several related work centers (or just one) may 
appear on one or more pages, followed by a page break before the next 
group of work centers.

Work Center A
   -some work to be done
   -some more work to be done

Work Center B
   -B's work to be done
   -some more work

---------- page break ----------

...more work centers, etc


It seems to me that since the -knowsPageRange method of my print view 
(which I have just written) must go through all of my work center 
data to determine when the pages should break in order to count them, 
it could also generate and store aside the rect for each page in an 
array as it does so.

Then my -rectForPage method could access that information to return 
the correct rect for the requested page without having to go through 
the nearly identical computations again.

Does this make sense and not violate anything? If this is commonly 
done (I can't be the first to think of this), did I miss discussion 
of it Apple's printing docs? Their custom pagination example is very 
simple (which they admitted) and to my mind didn't really discuss the 
issues that arise in an actual custom pagination situation.

http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/
Tasks/PaginatingViews.html#//apple_ref/doc/uid/20000912-BBCHHAHI

Thank you

Related mailsAuthorDate
mlIs it acceptable to use -knowsPageRange to generate page rects? Paul Bruneau Nov 29, 20:30
mlRe: Is it acceptable to use -knowsPageRange to generate page rects? Matt Neuburg Nov 30, 02:09