delphi中Printers 打印文本
来源:岁月联盟
时间:2010-10-31
procedure TForm1.Button1Click(Sender: TObject);
var
PText:TextFile;
i:integer;
begin
printer.Canvas.Font.Charset:=GB2312_CHARSET;
AssignPRN(PText);
Rewrite(PText);
Printer.Canvas.Font.Name:=黑体;
Printer.Canvas.Font.Size:=15;
writeln(Ptext,卡号:210008888888);
Printer.Canvas.Font.Size:=10;
writeln(Ptext,);
writeln(Ptext,密码:111111);
writeln(Ptext,);
Printer.Canvas.Font.Size:=8;
writeln(Ptext,开卡时间+datetimetostr(now));
writeln(Ptext,);
CloseFile(Ptext);
end;