这些票据打印机手册上都会有的,
这是票据打印一段代码(Epson LQ300K),仅供参考:
procedure PrintTicket(AStation,Achannel,Auserid,ATicketNo,
AMoney,APntdate,APnttime:string);stdcall;
var
F:TextFile;
...
begin
....
Assignfile(f,'LPT1');
rewrite(f);
{初始化打印机}
Write(f,chr(27)+'@');
//Chr(27)+'@' 即ESC @ 指令
{设置汉字显示方式}
write(f,chr(28)+chr(ord('&')));
//Chr(28) 即 FS
{设定打印相对水平位置}
Write(f,chr(27)+chr(ord('/'))+chr($CF)+chr($00));
//设置高速打印
//write(f,chr(28)+chr(ord('x'))+chr($01));
Writeln(f,PrintChannel+space(16)+Auserid+space(12)+carType);
Writeln(f);
write(f,chr(27)+chr(ord('/'))+chr($CF)+chr($00));
Write(f, AMoney);
Writeln(f,Space(26)+PrntTicketno);
Writeln(f);
write(f,chr(27)+chr(ord('/'))+chr($CF)+chr($00));
//Writeln(f);
Writeln(f,Apntdate+Space(12)+ApntTime);
//顺时针走纸控制
Writeln(f,chr(27)+chr(ord('J'))+chr($FF));
Writeln(f,chr(27)+chr(ord('J'))+chr($20));
flush(f);
Closefile(f);
end;