This method sets the retrieved printer names into the Printers property.
Parameters
None
Return Value
Returns True if successful, otherwise returns False
Explanation
The EnumPrinters method sets the retrieved printer names into the Printers property. The PrinterIndex property refers to the index of the default printer among those printers set in the Printers property. (The first printer in the list has an index of 0)
Example: How to locate the default printer
In C++Builder
VImageKit1->PrintDraw->EnumPrinters();
if (VImageKit1->PrintDraw->Printers->Count > 0)
{
ComboBox1->Items =
VImageKit1->PrintDraw->Printers;
ComboBox1->ItemIndex =
VImageKit1->PrintDraw->PrinterIndex;
}
In Delphi
VImageKit1.PrintDraw.EnumPrinters(); if (VImageKit1.PrintDraw.Printers.Count > 0) then begin ComboBox1.Items := VImageKit1.PrintDraw.Printers; ComboBox1.ItemIndex := VImageKit1.PrintDraw.PrinterIndex; end;
Differences between the ImageKit7/8/9
The DefaultPrinterNo parameter has been eliminated and the
PrinterIndex property has been added.
The return value has changed from an integer to a boolean.
The number of retrieved printers is retrieved in the Printers.Count
property.