actually, this can be done by code ))).
for example:
#include <Winspool.h>
BOOL setPageSize(CString printerName, int widthMM, int heightMM)
{
CString papersizeName = _T("MyCustomPage");
HANDLE hPrinter = NULL;
PRINTER_DEFAULTS pDef;
ZeroMemory(&pDef, sizeof(pDef));
pDef.DesiredAccess = PRINTER_ALL_ACCESS;
bool bGotPrinter = OpenPrinter((LPWSTR)printerName.GetString(), &hPrinter, &pDef);
if (!bGotPrinter || (hPrinter == NULL))
return FALSE;
DeleteForm(hPrinter, (LPWSTR)papersizeName.GetString()); // just for recreate
FORM_INFO_1 paperInfo;
paperInfo.Flags = 0;
paperInfo.pName = (LPWSTR)papersizeName.GetString();
paperInfo.Size.cx = widthMM * 1000; // size in 1000ths of millimeters
paperInfo.Size.cy = heightMM * 1000; // size in 1000ths of millimeters
paperInfo.ImageableArea.left = 0;
paperInfo.ImageableArea.right = paperInfo.Size.cx;
paperInfo.ImageableArea.top = 0;
paperInfo.ImageableArea.bottom = paperInfo.Size.cy;
return AddForm(hPrinter,1,(LPBYTE)&paperInfo);
}
and usage:
CString printer = _T("Fax");
if (TRUE == setPageSize(printer,150,200) ) acutPrintf(_T("\nDone"));
else acutPrintf(_T("\nFailed"));
but there are some limitations. your custom size must not be larger or smaller, than device support (for example, printer A4 cant have A0 paper size)
this code must be used before you start working with autocad printer data, if you want to see "MyCustomPage" in a list of available papers for your device, or you have to refind all of the papers again after function usage.