This method retrieves the paper size and specified printing area from the printer device context.

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPaperSizeVariant(hDC As LONG_PTR, left As Variant, top As Variant, right As Variant, bottom As Variant, Width As Variant, Height As Variant, UnitMode As DeviceUnitModeConstants)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPaperSizeVariant(hDC As Integer(x86) or Long(x64), ByRef left As Object, ByRef top As Object, ByRef right As Object, ByRef bottom As Object, ByRef Width As Object, ByRef Height As Object, UnitMode As ImageKit10(A)Lib.DeviceUnitModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.GetPaperSizeVariant(int(x86) or long(x64) hDC, ref object left, ref object top, ref object right, ref object bottom, ref object Width, ref object Height, ImageKit10(A)Lib.DeviceUnitModeConstants UnitMode)

* ImageKit10ALib refers to the ANSI version, ImageKit10Lib refers to the Unicode version, (x86) refers to the 32 bit version, and (x64) refers to the 64 bit version.

Parameters

Name Explanation
hDC Printer device context
left,top Retrieves the location of the top left corner of the specified printing area
right,bottom Retrieves the location of the bottom right corner of the specified printing area
Width Retrieves the width of the paper
Height Retrieves the height of the paper
UnitMode The units of measure of the retrieved values (0: pixels, 1: 0.1mm)

The following constants can be used: (ikPrinterPixel = 0, ikPrinterMM = 1).

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful.

Explanation

The GetPaperSizeVariant method retrieves the paper size and specified printing area from the printer device context.

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#.

When the UnitMode parameter is 0, the left, top, right, bottom, Width, and Height parameters will be in pixel units. When the UnitMode parameter is 1, the left, top, right, bottom, Width, and Height parameters will be in 0.1mm units.

Also see the GetPaperSize method.

Differences between the ImageKit7/8

The hDC argument type has changed.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation