gIni: string;PRatio: Integer=1);
{在 (Xmm, Ymm)处按指定配置文件信息和字体输出字符串}
var
fN: string;
inif: TIniFile;
dName: string;
bDefault:string;//是否使用缺省打印机
offSetX, offSetY: Integer;
pSize: Integer;
pWidth,pHeight: Double;
begin
pSize:=256;
pWidth:=239;
pHeight:=139.7;
offSetX:=0;
offSetY:=0;
fN := ConfigIni; // ExtractFilePath(Application.ExeName)+''\''+
if FileExists(fN) then
begin
inif:= TIniFile.Create(fN);
try
try
dName:=inif.ReadString(''Printer'',''DeviceName'',''error'');
bDefault:=inif.ReadString(''Printer'',''IsUseDefault'',''Yes'');
pSize:=StrToInt(inif.ReadString(''Printer'',''PaperSize'',''256''));
pWidth:=StrToFloat(inif.ReadString(''Printer'',''PageWidth'',''20''));
pHeight:=StrToFloat(inif.ReadString(''Printer'',''PageHeight'',''20''));
offSetX:= 0;
//StrToInt(inif.ReadString(''Printer'',''OffsetX'',''0''));
offSetY:= 0;
//StrToInt(inif.ReadString(''Printer'',''OffsetY'',''0''));
except
bDefault:=''Yes'';
pSize:=256;
pWidth:=239;
pHeight:=139.7;
offSetX:=0;
offSetY:=0;
end;
finally
inif.Free;
end;
end;
pHeight:=pHeight*PRatio;
FiOffsetX:=offSetX;
FiOffsetY:=offSetY;
if CompareText(bDefault,''Yes'')=0 then //是否使用缺省打印机
Printer.PrinterIndex:=-1
else
Printer.PrinterIndex:= Printer.Printers.IndexOf(dName);
SetPagerSize(pSize,pWidth,pHeight);
end;
//在 (Xmm, Ymm)处按指定配置文件信息和字体输出字符串
function TCustomPrinter.PrintText(Xmm, Ymm, LineHeight, TextWidth: Extended;
Txt: