procedure DrivePrint;
var
lines:integer;
prntext:TextFile;
//定义打印文本变量
spaceText:String;
begin
spaceText:=' ';
assignprn(prntext);
//将prntext文件分配给打印机
rewrite(prntext);
//打开prntext文件
QueryForm.memo1.Font.Name:='新宋体-18030';
QueryForm.memo1.Font.Size:=9;
printer.canvas.draw(170,0,queryForm.image1.picture.graphic);
//调整图片位置
printer.canvas.font:=queryForm.memo1.font;
//设置打印对象的canvas的字体
QueryForm.memo1.Lines.Insert(0,'');
QueryForm.memo1.Lines.Insert(1,'');
QueryForm.memo1.Lines.Insert(2,'');
QueryForm.memo1.Lines.Insert(3,'');
for lines:=0 to QueryFORM.memo1.lines.count-1do
writeln(prntext,spacetext+QueryForm.memo1.lines[lines]);
//把Memo1的内容写到打印机对象
system.close(prntext);
//关闭打印文件
end;