
Print/Fax Style
A Bit about Printing
The system implements printing differently depending on the type of printing (the differences are usually transparent to the application programmer). For PostScript printers, each view on the page is converted to a PostScript equivalent, and then the PostScript representation of the printed page is sent to the printer. For bitmap printers, the Newton images the page into an offscreen bitmap and then sends those bits to the printer. Since there is not enough memory to hold the entire page in an offscreen bitmap, the Newton images the page in horizontal bands from top to bottom. All views that intersect this band are then drawn, and the bits for that band are sent to the printer. The offscreen buffer is then used for the next band.
The views involved in printing receive a number of different system messages. At the very beginning, the protoPrintFormat view receives a FormatInitScript
message. Then, the protoPrintFormat view and all of its descendants receive these messages:
viewSetupFormScript
viewSetupChildrenScript
viewSetupDoneScript
At the end of each page, the protoPrintFormat
receives a printNextPageScript
message. During each band, each view that intersects the band is also sent the viewDrawScript
message.
From any of these methods, you can access the target
frame (via parent inheritance). Slot layer protos also work just fine.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996