POS打印机一些特殊控制

procedure TForm1.Button1Click(Sender: TObject);
var
RPrinter:TextFile;
i:integer;
begin

{设置打印机}
Assignfile(RPrinter,\'lpt1\');

{准备写文件}
Rewrite(RPrinter);

{打印}
for i := 0 to memo1.lines.Count - 1 do
Writeln(RPrinter,memo1.lines[i]);

{向后倒纸}
Writeln(RPrinter,chr($b)+chr(27)+\'K\'+chr(40));

{向前进纸}
Writeln(RPrinter,chr($b)+chr(27)+\'J\'+chr(140));

{开钱箱}
writeln(f,CHR(27)+CHR(112)+CHR(0)+CHR(17)+CHR(8));
write(f,CHR(27)+CHR(112)+CHR(0)+CHR(17)+CHR(8));
Chr(27)+\'p\'+chr(0)+chr(60)+chr(255)

{关闭打印机}
CloseFile(RPrinter);
end;

如何检测“LPT1” 端口是否可以用!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zgjwgp.html