这是24针的检测。
const
n=10;
var
i:integer;
begin
with printerdo
if not printing then
if printersetupdialog1.Execute then
begin
setmapmode(handle,mm_text);
begin
doc;
for i:=0 to 23do
begin
canvas.moveto(100,(n+i*2)*24+i);
canvas.LineTo(300,(n+i*2)*24+i);
canvas.TextOut(320,(n+i*2)*24+i,'第'+inttostr(i+1)+'针');
end;
enddoc;
showmessage('打印命令已经发出');
end;
end;