procedure TForm1.Button1Click(Sender: TObject);
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:=256;
pDMode^.dmPaperLength:=1140;
pDMode^.dmPaperWidth:=1900;
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;
procedure TForm1.Button2Click(Sender: TObject);
begin
With Printerdo
begin
begin
Doc;
Canvas.TextOut(10,10,'fkgfjhg');
EndDoc;
end;
end;