procedure ChangePageHeight(value:do
uble);
// value in CM
var
sDrv: Pchar;
sPrt: Pchar;
DevAdr: THandle;
p: PDeviceModeA;
begin
sdrv := allocmem(256);
sprt := allocmem(64);
devadr := 0;
try
printer.GetPrinter(sdrv, sdrv, sprt, devadr);
p := ptr(devadr);
p^.dmFields := DM_PAGESIZE or DM_PAPERLENGTH;
p^.dmPageSize := 0;
// 自定义类型
p^.dmPaperLength := ceil(value * 100);
do
cumentProperties(0, printer.handle, sdrv, p^, p^,
DM_IN_BUFFER);
finally
freemem(sdrv, 256);
freemem(sprt, 64);
end;
end;