This method retrieves the names, size numbers, and dimensions of the paper from the printer designated by the printer name.
Parameters
Name | Explanation |
---|---|
PaperNames | An array containing the retrieved paper names In C++Builder, pass PaperNames count - 1 into PaperNames_Size |
PaperNumbers | An array containing the retrieved paper size numbers In C++Builder, pass PaperNumbers count - 1 into PaperNumbers_Size |
PaperSizes | An array containing the paper size In C++Builder, pass PaperSizes count - 1 into PaperSizes_Size |
Return Value
Returns the number of retrieved items. Returns 0 if unsuccessful.
Explanation
The EnumPaperSizes method retrieves the names, size numbers, and dimensions of the paper from the printer designated by the printer name. If you need to know the number of elements in the array, the GetArrayNum method can be used to retrieve this.
Sample code:
In C++Builder
int Size;
UnicodeString *PaperNames;
Word *PaperNumbers;
TPoint *PaperSizes;
VImageKit1->PrintDraw->PrinterName = "EPSON LP-8200C";
Size =
VImageKit1->PrintDraw->GetArrayNum(vikPrinterPaperSize);
if (Size < 1) return;
PaperNames = new UnicodeString[Size];
PaperNumbers = new Word[Size];
PaperSizes = new TPoint[Size];
__try {
VImageKit1->PrintDraw->EnumPaperSizes(PaperNames, Size - 1,
PaperNumbers, Size - 1, PaperSizes, Size - 1);
// do stuff here
********************
} __finally {
delete[] PaperNames;
delete[] PaperNumbers;
delete[] PaperSizes;
}
In Delphi
Size: Integer;
PaperNames: array of string;
PaperNumbers: array of Word;
PaperSizes: array of TPoint;
VImageKit1.PrintDraw.PrinterName := 'EPSON LP-8200C';
Size := VImageKit1.PrintDraw.GetArrayNum(vikPrinterPaperSize);
if Size < 1 then Exit;
SetLength(PaperNames, Size);
SetLength(PaperNumbers, Size);
SetLength(PaperSizes, Size);
VImageKit1->PrintDraw->EnumPaperSizes(PaperNames,
PaperNumbers, PaperSizes);
// do stuff here
********************
Differences between the ImageKit7/8/9
PaperNames has changed from a string type to a string array.
In C++Builder it is necessary to pass in the count of PaperNames,
PaperNumbers, and PaperSizes parameters.