|
I use a bs_300k printer and use delphi to write directly to the parallel port. After how to go 6-7, the ticket will jump up a bit.
strange
PrntTicketno:=Copy(ATicketno,(length(ATicketNo)-1),2);
AMoney:=Num2CNum(StrToInt(AMoney));
PrintChannel:=getSetupIni('Current','no');
stationId:=getSetupIni('Current','id');
Assignfile(f,'LPT1');
rewrite(f);
{Initialize printer}
// Write(f,chr(27)+'@'); //chr(27)=ESC
{Set the display mode of Chinese characters}
//write(f,chr(28)+chr(ord('&'))); //chr(28)=FS
{Set relative horizontal position of printing}
// Write(f,chr(27)+chr(ord('\'))+chr($FF)+chr($00));
Write(f,chr(28)+chr(51)+chr(63));
Write(f,chr(27)+chr(43)+chr(63));
//Set high-speed printing
// write(f,chr(28)+chr(ord('x'))+chr($01));
Writeln(f);
Writeln(f,''+stationid+''+PrintChannel+''+Auserid+''+PrntTicketno);
Writeln(f);
write(f,chr(27)+chr(ord('\'))+chr($CF)+chr($00));
//Enlarge the amount font
Write(f,chr(28)+chr(ord('W'))+chr($01));
Write(f, ''+AMoney);
//Remove the enlarged font
Write(f,Chr(28)+chr(ord('W'))+chr($00));
Writeln(f);
Writeln(f);
write(f,chr(27)+chr(ord('\'))+chr($CF)+chr($00));
Writeln(f,''+Apntdate+''+ApntTime);
Write(f,chr(27)+chr(ord('J'))+chr($FF));
Write(f,chr(11));
flush(f);
Closefile(f); |
|