1 printer.getprinter(mdevice, mdriver, mport, mhdmode); 2 3 printer.setprinter(pchar(g_PRNzt), mdriver, mport, mhdmode);// 设置打印机,pchar(g_PRNzt)--打印机名称 4 printer.Canvas.Font.name:='宋体'; 5 printer.Canvas.Font.Size:=10; 6 assignprn(prntext); 7 Rewrite(prntext); 8 writeln(prntext, ' 总台打印机测试') ; 9 CloseFile(prntext);