Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Stingray Foundation Library User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

9.2 Printable Objects

Objects that implement the IPrintable interface can participate in printing and print preview. The IPrintable interface is shown in Example 86 below.

Example 86: The IPrintable interface

Printable objects are expected to output one page at time to a document object. They implement the BeginPage(), PrintPage(), and EndPage() functions in order to print a single page. The BeginPage() and EndPage() functions provide the printable object with an opportunity to separate the process of printing a page into three steps. The document object passed into these functions provides a device context on which to render the pages. Printable objects must also provide a count of the total number of printed pages in a given job by implementing the GetPageCount() function. A printable object can implement GetPageCount() either by returning the number of pages it contains or by returning –1 to indicate that the printing should continue until PrintPage() returns false. Printable objects do not drive the printing process – they simply respond to requests for pages of printed output.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.