找到winpplb.dll
function Set_Darkness(darkness: integer): integer;
stdcall;
external 'WINPPLB.DLL';
function CreatePrn(selection: integer;
FileName: pchar): integer;
stdcall;
external 'WINPPLB.DLL';
function Print_Out(copypiece: integer): integer;
stdcall;
external 'WINPPLB.DLL';
function Prn_Text(x, y, ori, font, hor_factor, ver_factor: integer;
mode: char;
data: pchar): integer;
stdcall;
external 'WINPPLB.DLL';
function Prn_Barcode(x, y, ori: integer;
typee: pchar;
narrow, width, height: integer;
human: char;
data: pchar): integer;
stdcall;
external 'WINPPLB.DLL';
function Prn_Text_TrueType(x, y, FSize: integer;
FType: pchar;
Fspin, FWeight, FItalic, FUnline, FStrikeOut: integer;
id_name, data: pchar): integer;
stdcall;
external 'WINPPLB.DLL';
function Get_Pcx(x, y: integer;
filename: pchar): integer;
stdcall;
external 'WINPPLB.DLL';
procedure ClosePrn();
stdcall;
external 'WINPPLB.DLL';
procedure printbar(matname, bar, matunit: string;
price:do
uble;
printnum: integer);
var
i: integer;
s: string;
begin
for i := 1 to printnumdo
begin
Prn_Text_TrueType(curcolumn * argox_dotper + 30, //x方向间隔是2mm
paperindex * 20 + 15, 20, pchar('宋体'), 1, 400, 0, 0, 0, pchar('A' + inttostr(curcolumn)), pchar(matname));
Prn_Barcode(curcolumn * argox_dotper + 40,
paperindex * 20 + 40, 0, pchar(bartype), 2, 2, 50, 'b', pchar(bar));
if printprice then
s := format('单价:%.2f元', [price]) else
s := '';
if printmatunit then
s := s + ' 单位:' + matunit;
Prn_Text_TrueType(curcolumn * argox_dotper + 40,
paperindex * 20 + 110, 20, pchar('宋体'), 1, 400, 0, 0, 0, pchar('B' + inttostr(curcolumn)), pchar(s));
inc(curcolumn);
curcolumn := curcolumn mod columnnum;
if curcolumn = 0 then
Print_Out(1);
end;
end;