利用重定向呀!! function TFixtureControl.Print(Content:string):Boolean; var MYFile:TextFile; begin try Assignfile(MyFile,'\\fs\lpt1'); Rewrite(MyFile); Writeln(MyFile,Content); System.CloseFile(MyFile); except end; end;
var MYFile:TextFile; begin try Assignfile(MyFile,'\\(local)\lpt1'); Rewrite(MyFile); Writeln(MyFile,Content); System.CloseFile(MyFile); except end; end;//这样不行,把(local)换成其他的名称(有打印机)也不行
function TFixtureControl.Print(Content:string):Boolean;
var
MYFile:TextFile;
begin
try
Assignfile(MyFile,'\\fs\lpt1');
Rewrite(MyFile);
Writeln(MyFile,Content);
System.CloseFile(MyFile);
except
end;
end;
MYFile:TextFile;
begin
try
Assignfile(MyFile,'\\(local)\lpt1');
Rewrite(MyFile);
Writeln(MyFile,Content);
System.CloseFile(MyFile);
except
end;
end;//这样不行,把(local)换成其他的名称(有打印机)也不行
先用BeginDoc开始打印
之后你就在它的Canvas上输出你要的东西
换页用NewPage
完毕之后用EndDoc结束