得到不可打印区域.txt

来自「大量Delphi开发资料」· 文本 代码 · 共 52 行

TXT
52
字号
var


  pntMargins : TPoint;


begin


  { @ means " the address of the variable" }


  Escape(Printer.Handle, GETPRINTINGOFFSET,0,nil,@prntMargins);


end;




Getting the Right and Bottom Margins aren't quite so straightforward. There isn't an equivalent Escape call. You obtain these values by getting the physical width

(physWidth) and height (physHeight) of the page, the printable width (PrintWidth) and height (PrintHeight) of the page, and then carrying out the following sums:


RightMargin    := physWidth  - PrintWidth  - LeftMargin


BottomMargin := physHeight - PrintHeight - TopMargin


The physical page size is found using Escape, this time with the GETPHYSPAGESIZE parameter. The point pntPageSize contains the page width in pntPageSize.x

and page height in pntPageSize.y




var


  pntPageSize : TPoint;


begin


   Escape(Printer.Handle, GETPHYSPAGESIZE,o,nil,@pntPageSize);


end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?