SetPaperLength

 

Sets the dmPaperLength member of the DevMode. (DM.dmPaperLength member of the BlackIceDEVMODE ) This value represents the 'Actual paper length'.

 

Before using this function, enable custom paper sizes, by calling the SetPaperSize function with the 256 (DMPAPER_CUSTOM) value:

 

SetPaperSize(256, pDevMode);

 

The SetPaperLength function expects the value in tenths of millimeters. To specify a value in pixels, use the GetYDPI function and the following formula:

 

SetPaperLength((int)(HeightInPixels * 254.0 / (float)GetYDPI(pDevMode)), pDevMode);

 

The 256 (DMPAPER_CUSTOM) paper size is intended for custom printing applications. Regular applications may not handle this paper size correctly. To add a named paper size to the paper list of the printer that is handled correctly by all applications, use the AddPaperSize function. After changing the paper list or the selected paper size, most applications have to be restarted for the changes to take effect.

 

SetPaperLength(paperlength As Long, pDevMode As Long) As Boolean;

 

Input value: paperlength  - Actual paper length (Long).

Input value: pDevMode    - handle to the BlackIceDEVMODE structure.

Return value                                    - TRUE if the member was successfully set, otherwise FALSE.


NOTE: For 32-bit applications, use pDevMode as Integer, instead of Long.