In this example, you create a brochure with four frames from an animation and three pages of text. The animation view is an animation graphic about 4 x 5 inches in size. The text is contained in a large view of four page-size inner views.The four animation images appear on one page. Figure 101
shows the finished brochure. The first page is the 4-up composite and the remaining pages are from the text.
TPrinter printer(TPrinter::kSystemPrinter);
TBookPageFolio demoTiledPageFolio(demoPage,demoView);
TStandardPageDescription textPage(kStandard, TPageDescription::kUSLetter);
TBookPageFolio demoTextPages(textPage,textView, TRUE,TGPoint::kOrigin,TGPoint::kOrigin,TGPoint(0,0.5));
TCompoundPageFolio* animationFolio = new TCompoundPageFolio;
animationFolio->AddFolio(&demoTiledPageFolio); animationFolio->AddFolio(&demoTiledPageFolio); animationFolio->AddFolio(&demoTiledPageFolio); animationFolio->AddFolio(&demoTiledPageFolio);
TNUpCompositor* fourUp = new TNUpCompositor(TULongPair(2,2));
TCompositedFolio fourUpFolio(fourUp,animationFolio);
TCompoundPageFolio brochureFolio; brochureFolio.AddFolio(&fourUpFolio); brochureFolio.AddFolio(&demoTextPages);
TStandardPageRange* pageRange = new TStandardPageRange;
pageRange->Not(2);
TPageIterator* demoIterator = brochureFolio.CreatePageIterator(pageRange);
TPrintJobDescription demoJob(printer.CreateJobDescription());
demoIterator->Print(demoJob); delete demoIterator;