RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPrinter Class

TPrinter encapsulates the Windows printer interface.

Pascal
TPrinter = class(TObject);
C++
class TPrinter : public TObject;

Printers

Use TPrinter to manage any printing performed by an application. Obtain an instance of TPrinter by calling the Printer function in the Printers unit. 

To determine how the printed image of the form appears, use the PrintScale property of a TForm component. 

A print job is started by a call to BeginDoc. The application sends commands by rendering through a Text variable or the printer's canvas. You can move to a new page by calling the NewPage method. The job stays open until the application calls EndDoc. If a problem occurs and you need to terminate a print job that was not sent to the printer successfully, call the Abort method. 

Use the TPrinter properties to configure the print job. For example, the title displayed in the Print Manager (and on network header pages) is determined by the Title property. Copies determines the number of copies to print, and Orientation lets you specify whether to print in portrait or landscape mode. 

TPrinter includes several read-only properties as well, that let you determine which page is currently being printed, the fonts available on the printer, the paper size, and so on. 

When creating a TPrinter descendant, you must call the SetPrinter routine in order for the TPrinter descendant object to work correctly. 

 

Printer 

TCustomForm 

SetPrinter Routine

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!