PRINTING A DOCUMENT
It’s time to take a look at how you can print a sketch. You already have a basic printing capability implemented in Sketcher, courtesy of the Application Wizard and the framework. The File ⇒ Print, File ⇒ Print Setup, and File ⇒ Print Preview menu items all work. Selecting the File ⇒ Print Preview menu item displays a window showing the current Sketcher document on a page, as shown in Figure 17-4.
Whatever is in the current document is placed on a single sheet of paper at the current view scale. If the document’s extent is beyond the boundary of the paper, the section of the document off the paper won’t be printed. If you select the Print button, this page is sent to your printer.
As a basic capability that you get for free, it’s quite impressive, but it’s not adequate for our purposes. A typical document in Sketcher may well extend beyond a page, so you would either want to scale the document to fit, or, perhaps more conveniently, print the whole document over as many pages as necessary. You can add your own print processing code to extend the capability of the facilities provided by the framework, but to implement this you first need to understand how printing has been implemented in MFC.
The Printing Process
Printing a document is controlled by the current view. The process is inevitably a bit messy because printing is inherently a messy business, ...
Get Ivor Horton's Beginning Visual C++ 2012 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.