C
Chxn
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
PageMargin:TPoint;
MyEscape:Integer;
begin
Printer.PrinterIndex:=Printer.PrinterIndex;
PageMargin.x:=0;
PageMargin.y:=0;
MyEscape:=GETPRINTINGOFFSET;
if Escape(Printer.Canvas.Handle,QUERYESCSUPPORT,SizeOf(MyEscape),@MyEscape,Nil)>0 then
begin
if Escape(Printer.Canvas.Handle,GETPRINTINGOFFSET,0,Nil,@PageMargin)<=0 then
begin
PageMargin.x:=0;
PageMargin.y:=0;
end;
Edit1.Text:='Width:'+inttostr(printer.PageWidth)+
';Height:'+Inttostr(Printer.PageHeight)+
';Point.x:'+inttostr(PageMargin.x)+
';Point.y:'+inttostr(PageMargin.y);
end;
end;
var
PageMargin:TPoint;
MyEscape:Integer;
begin
Printer.PrinterIndex:=Printer.PrinterIndex;
PageMargin.x:=0;
PageMargin.y:=0;
MyEscape:=GETPRINTINGOFFSET;
if Escape(Printer.Canvas.Handle,QUERYESCSUPPORT,SizeOf(MyEscape),@MyEscape,Nil)>0 then
begin
if Escape(Printer.Canvas.Handle,GETPRINTINGOFFSET,0,Nil,@PageMargin)<=0 then
begin
PageMargin.x:=0;
PageMargin.y:=0;
end;
Edit1.Text:='Width:'+inttostr(printer.PageWidth)+
';Height:'+Inttostr(Printer.PageHeight)+
';Point.x:'+inttostr(PageMargin.x)+
';Point.y:'+inttostr(PageMargin.y);
end;
end;