This method retrieves the paper size and specified printing area from the printer device context.
[Visual Basic] [ Boolean
=
]imagekitcontrolname.PrintDraw.GetPaperSize(hDC
As Long, 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
hDC, long *left, long *top, long *right, long *bottom, long *Width,
long *Height, long UnitMode)
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) |
In Visual Basic 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 and other programs that require variant types, please refer to the GetPaperSizeVariant method.