The IlvPrinter Class

The IlvPrinter class describes a physical printer with characteristics such as paper size, paper orientation, and physical margins. It encapsulates an instance of IlvPort.

This is an abstract class and it has two predefined subclasses:

  • IlvPSPrinter that allows you to print to a PostScript file.

// creating a PostScript printer

IlvPSPrinter* psprinter = new IlvPSPrinter(display);

psprinter->setPaperFormat(*IlvPaperFormat::Get("A3"));

psprinter->setOrientation(IlvPrinter::Landscape);

psprinter->setDocumentName("viewsprint.ps");

  • IlvWindowsPrinter that allows printing to a printer connected to a Windows computer (this class is only available on Windows).

Some characteristics are dependent on the printer and cannot be set, such as paper size or margins.

// creating a Windows printer

IlvWindowsPrinter* wprinter = new IlvWindowsPrinter(display);