不同打印机可能指令集会不同,自己参考以下说明书
***** 八种常用类型条码命令*****
(1) EAN--13
Write( lpt, CHR(28)+CHR(80)+CHR(1)+CHR(2)+CHR(2)+CHR(3)+CHR(12)+'012345678901');
(2) EAN--8
Write( lpt, CHR(28)+CHR(80)+CHR(2)+CHR(2)+CHR(2)+CHR(3)+CHR(7)+'4718290');
(3) UPC--A
Write( lpt, CHR(28)+CHR(80)+CHR(3)+CHR(2)+CHR(2)+CHR(3)+CHR(11)+'012345678900');
(4) UPC--E
Write( lpt, CHR(28)+CHR(80)+CHR(4)+CHR(2)+CHR(2)+CHR(3)+CHR(7)+'0143121');
(5) CODE--39
Write( lpt, CHR(28)+CHR(80)+CHR(5)+CHR(2)+CHR(2)+CHR(3)+CHR(8)+'*C0DE39*');
(6) INTERLEAVED--25
Write( lpt, CHR(28)+CHR(80)+CHR(6)+CHR(2)+CHR(3)+CHR(3)+CHR(4)+'3214');
(7) CODABAR
Write( lpt, CHR(28)+CHR(80)+CHR(7)+CHR(2)+CHR(2)+CHR(3)+CHR(5)+'D123D');
(8) CODE--128
Write( lpt, CHR(28)+CHR(80)+CHR(8)+CHR(2)+CHR(2)+CHR(3)+CHR(5)+CHR(137)+'C128');
例:
VAR
lpt :TextFile
begin
AssignFile( lpt, 'LPT1' );
ReWrite( lpt );
Write( lpt, CHR(28)+CHR(80)+CHR(1)+CHR(2)+CHR(2)+CHR(3)+CHR(12)+'012345678901');
Write( lpt, #12 );
//打印机换页
CloseFile( lpt );
END