VPrinter

A printer object, with a dialog to interactively set printer attributes.

Synopsis

 * Header:
 * 


 * Class name:
 * vPrinter

Description
The vPrintDC class prints to a printer (or a file that will eventually be printed). Printers have such attributes as size of paper, page orientation, color capability, etc. By calling the vPrinter::Setup dialog before printing, the user will be given the option of setting various printer attributes.

The exact functionality of the Setup dialog will be platform dependent. By using the vPrinter class, you will get the behavior appropriate for the platform. If you want to use the vPSPrintDC class for PostScript support on Windows, you can use vPSPrinter directly.

You can use the various methods associated with a vPrinter</tt> to get printer attributes as needed to during drawing to the vPrintDC</tt>.

void SetCopies(int s)
Many printers support printing multiple copies of the same document. This attributes controls the number of copies printed. The Setup</tt> dialog will provide control of this if it is supported.

char* GetDocName
Printer output may be directed to a file rather than the printer. If it is, this will return the name of the file the output will be sent to.

char* GetPaperName
Printers can print a variety of papers. The user may be able to select which paper from the Setup</tt> dialog. The printers supported are defined in the vprinter.h</tt> header file (or the base class used by vPrinter</tt>).

void SetPortrait(int p)
Many printers can print in either Portrait or Landscape orientation. This returns true if the printer will print in portrait.

void SetToFile(int f)
Printer output may be directed to a file rather than the printer. This returns true if the user selected the option to send output to a file.

void SetUseColors(int c)
Printers can be either black and white, or color. This returns true if the printer supports colors. You can make a color printer print black and white by setting this to false.

int Setup(char* fn = 0)
This displays a modal dialog for the user to select desired printer characteristics. If a filename is supplied, that name will be used if the user selects print to file. If Setup</tt> returns false, you should abandon the print job. After you call Setup</tt>, you can then call vPrintDC::SetPrinter</tt> to associate the printer with the vPrintDC</tt>.

Example
See vPrintDC</tt> for an example of using vPrinter::Setup</tt>.