Introducing the Printer Object

The Printer object is the primary method used to access the printer. It has many properties and methods in common with the Picture control, plus a few that are unique to the Printer object. Table 9.1 lists the properties and methods common to both objects, and Table 9.2 lists the properties and methods specific to the Printer object.

NOTE: The Printer object versus the Picture control: These are very similar in nature and function. Both offer a canvas for you to create your own artwork. The only significant differences between them relate to the physical differences between a video display and a printer—you can clear a screen but not a printer page, and you can start another page in the printer but you can’t do that with a video display.

Table 9.1: Printer Object and Picture Control Properties and Methods

Property/Method Description
Circle method Draws a circle or an ellipse
CurrentX property Specifies the horizontal coordinate of the cursor
CurrentY property Specifies the vertical coordinate of the cursor
DrawStyle property Specifies the pattern used to draw the line
DrawWidth property Specifies the width of the line in pixels
FillColor property Specifies the interior color for shapes
FillStyle property Specifies the pattern used to fill shapes
Font property Specifies the font characteristics for text output
ForeColor property Sets the color used to draw the shapes and characters on the object
hDC property Specifies the device context used to access the device
Height property Specifies the height of the work area in twips
Line method Draws a line between the specified coordinates
PaintPicture method Draws the picture at the specified location
Print method Outputs the specified text to the object
Pset method Draws a point at the specified location
Scale method Defines the coordinate system used to describe the work area
ScaleHeight property Contains the Height in the units specified by ScaleMode
ScaleLeft property Contains the Left position in the units specified by ScaleMode
ScaleMode property Specifies the unit of measure for the Scale properties
ScaleTop property Contains the Top in the units specified by ScaleMode
ScaleWidth property Contains the Width in units specified by ScaleMode
ScaleX method Computes a value for the specified width value in a different scale
ScaleY method Computes a value for the specified height value in a different scale
TextHeight method Computes the height of the specified string using ScaleMode and the specified font information
TextWidth method Computes the width of the specified string using ScaleMode and the specified font information
Width property Contains the width of the work area in twips

Table 9.2: Printer Object-Specific Properties and Methods

Property/Method Description
EndDoc method Finishes the current print operation and releases the output to the print spooler or printer
Fonts property Contains an object reference with the list of fonts that can be used with the printer
KillDoc method Finishes the current print operation and discards the output
NewPage method Ejects the current page and begins a new page
Orientation property Specifies if the printer’s paper is placed in portrait mode or landscape mode
Page property Specifies the current page number
PaperSize property Specifies the size of the paper in the printer
PrintQuality property Specifies the relative quality of the output
TrackDefault property Specifies whether to change the default Printer object whenever the Windows default Printer object is changed
Zoom property Specifies the scaling factor of the output

© 1998 SYBEX Inc. All rights reserved.