About pagination
About pagination
- Subject: About pagination
- From: John Blackburn <email@hidden>
- Date: Mon, 5 Nov 2001 21:16:07 -0800
What's the best way to print a series of related-but-non-tiled pages?
From what I've read in the documentation for NSView and the various
NSPrintxxx classes, the printing architecture assumes your multi-page
drawing occurs on a single large canvas which is then printed in
successive pages, like a canvas with the word hello on it where each
letter is printed onto its own page:
Page 1: H
Page 2: E
Page 3: L
Page 4: L
Page 5: O
My application needs to output a series of pages which represent
complementary views of the same page, like an app where you type hello
which then prints that word in various languages, one to a page:
Page 1: hello
Page 2: guten tag
Page 3: howdy
Page 4: bon jour
I see that my view needs to call
- (BOOL)knowsPageRange:(NSRangePointer)range
to set the first page number and the page count, but there doesn't
appear to be a corresponding routine invoked per page which would tell
me when to draw which page. I can see that that the call
- (NSRect)rectForPage:(int)pageNumber
allows me specify a rect for the individual pages, and I realize I could
use that for a hideous kludge where the corresponding page number is
derived from the page rect, but hoo boy, that'd hurt.
Is an elegant approach for this problem documented somewhere someone can
point me to?
Thanks,
John Blackburn