procedure ChangePaperType(value: Integer);
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_PAPERSIZE;
p^.dmPaperSize := value;
do
cumentProperties(0, printer.handle, sdrv, p^, p^,
DM_IN_BUFFER);
finally
freemem(sdrv, 1024);
freemem(sprt, 256);
end;
end;