Sign in Join
FPDoc Onlineexperiment

TPrinter.PrinterIndex property

Member of TPrinterpublicIn unit Printers

Contains the ordinal position in Printers for the selected print device.

Declaration

pascal
property PrinterIndex: Integer read GetPrinterIndex write SetPrinterIndex;

Description

PrinterIndex is an Integer property which contains the ordinal position in Printers for the selected print device. The default value for the property is -1, and indicates that a print device has not been selected and that the default printer should be used. The default printer is the first one in the Printers property.

Setting a new value in PrinterIndex causes the CheckPrinting method to be called to ensure that the value in Printing is False. An exception is raised in CheckPrinting when Printing is set to True. Set the value for the property prior to calling the BeginDoc method.

An exception may also be raised for the following conditions:

  • PrinterIndex is set to a value greater than or equal to 0 and the list of Printers is empty.
  • PrinterIndex is set to a value larger than the number of entries in Printers.

The SetPrinter method is called to make the named device the selected print device. DoResetFontsList is called to reload the values in the Fonts property.

Errors

EPrinter
Raised with the message 'Printer is printing'. Raised with the message 'No printers defined!'. Raised with the message 'Printer index out of range!'.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.