#include “BlackIceDEVMODE.h”
BOOL SetPaperWidth (int Width, BlackIceDEVMODE* pDevMode);
Description
Sets the dmPaperWidth member of the DEVMODE. (DM.dmPaperWidth member of the BlackIceDEVMODE ) This value represents the 'Actual paper width'.
Before using this function, enable custom paper sizes, by calling the SetPaperSize function with the 256 (DMPAPER_CUSTOM) value:
SetPaperSize(256, pDevMode);
The SetPaperWidth function expects the value in tenths of millimeters. To specify a value in pixels, use the GetXDPI function and the following formula:
SetPaperWidth((int)(WidthInPixels * 254.0 / (float)GetXDPI(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.
Parameters
int Width - value of the new paper width
BlackIceDEVMODE* pDevMode - pointer to the BlackIceDEVMODE structure.
Return value
TRUE on success, otherwise FALSE.
Programming Notes
None
Code Example
None