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

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPaperSize(hDC As LONG_PTR, left As Long, top As Long, right As Long, bottom As Long, Width As Long, Height As Long, UnitMode As DeviceUnitModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().GetPaperSize(LONG_PTR hDC, long *left, long *top, long *right, long *bottom, long *Width, long *Height, long UnitMode)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPaperSize(hDC As Integer(x86) or Long(x64), ByRef left As Integer, ByRef top As Integer, ByRef right As Integer, ByRef bottom As Integer, ByRef Width As Integer, ByRef Height As Integer, UnitMode As ImageKit10(A)Lib.DeviceUnitModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.GetPaperSize(int(x86) or long(x64) hDC, ref int left, ref int top, ref int right, ref int bottom, ref int Width, ref int 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 GetPaperSize method retrieves the paper size and specified printing area from the printer device context. 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.

For scripting languages, other programs that require variant types, or when using 64 bit builds in VB.NET or C#, please refer to the GetPaperSizeVariant method.

Differences between the ImageKit7/8

The hDC argument type has changed.

The ImageKit10 ActiveX is a product created by Newtone Corporation