This method retrieves the names, size numbers, and dimensions of the paper from the printer designated by the printer name.

[Visual Basic]   [ Long = ]imagekitcontrolname.PrintDraw.EnumPaperSizesVariant(PaperNames As Variant, PaperNumbers As Variant, Width As Variant, Height As Variant)
[VB.NET]   [ Integer = ]imagekitcontrolname.PrintDraw.EnumPaperSizesVariant(ByRef PaperNames As Object, ByRef PaperNumbers As Object, ByRef Width As Object, ByRef Height As Object)
[C#.NET]   [ int = ]imagekitcontrolname.PrintDraw.EnumPaperSizesVariant(ref object PaperNames, ref object PaperNumbers, ref object Width, ref object Height)

Parameters

Name Explanation
PaperNames The string containing the retrieved paper names
PaperNumbers The array containing the retrieved paper size numbers

* NOTE for retrieving array values:
In Visual Basic / VB.NET, if Dim Pnum, then the arguments are returned in Pnum.
In C#.NET the arguments are returned in ref Pnum.

Width, Height The array containing the retrieved paper dimensions

* NOTE for retrieving array values:
In Visual Basic / VB.NET, if Dim Width, then the arguments are returned in Width.
In C#.NET the arguments are returned in ref Width.

Return Value

Returns the number of retrieved items. Returns 0 if unsuccessful.

Explanation

The EnumPaperSizesVariant method retrieves the names, size numbers, and dimensions of the paper from the printer designated by the printer name.

This method is recommended when using scripting or other languages that require variant types or when using 64 bit builds in VB.NET or C#.

If you need to know the number of elements in the array, the GetArrayNum method can be used to retrieve this. The PaperNames string will be returned as "xxxxx,xxxxx,xxxxx,¥¥¥¥¥¥¥¥," (delimited by commas and ends with a comma). The Width and Height parameters retreieve each paper size in 0.1mm units.

Also see the EnumPaperSizes method.

 

Sample code:

VB.NET

    Dim Ret As Integer

 

    ImageKit1.PrintDraw.PrinterName = "EPSON LP-8200C"

    Dim PaperNames As Object = Nothing

    Dim PaperNumbers As Object = Nothing

    Dim Width As Object = Nothing

    Dim Height As Object = Nothing

    Ret = ImageKit1.PrintDraw.EnumPaperSizesVariant(PaperNames, PaperNumbers, Width, Height)

    If Ret < 1 Then Exit Sub

        ' various programming code

    .........

 

C#.NET

    int Ret;

    ImageKit1.PrintDraw.PrinterName = "EPSON LP-8200C";

    object PaperNames = null;

    object PaperNumbers = null;

    object Width = null;

    object Height = null;

    Ret = ImageKit1.PrintDraw.EnumPaperSizesVariant(ref PaperNames, ref PaperNumbers, ref Width, ref Height);

    if (Ret < 1) return;

        // various programming code

    .........

The ImageKit10 ActiveX is a product created by Newtone Corporation