procedure printer_set;
var
Device:Array[0..256] of Char;
Driver:Array[0..256] of Char;
Port:Array[0..32] of Char;
hDMode:THandle;
pDMode
DevMode;
begin
Printer.GetPrinter(Device,Driver,Port,hDMode);
if hDMode<>0 then
pDMode:=GLobalLock(hDMode);
if pDMode<>nil then
begin
pDMode^.dmPaperSize:=0;
pDMode^.dmPaperLength:=100;
pDMode^.dmPaperWidth:=210;
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERSIZE;
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERLENGTH;
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERWIDTH;
end;
ResetDC(Printer.Handle,pDMode^);
GLobalUnLock(hDMode);
end;