Windows的打印机制是按页面进行处理的。
如果正确设置了纸张的长度,某些驱动程序是不会自动按页走纸的。

解决方案 »

  1.   

    打印时不要用文本方式打开:
    assignprn(prntext); //将PRNTEST分配给打印机
    rewrite(prntext);//调用REWRITE函数,为输出打开已分配的文件而要用图形方式,textout打印即可完美控制
      Printer.Canvas.TextOut
      

  2.   

    用F1BOOK控件做报表也很好控制
      

  3.   

    给你一段代码,自己去看吧,相信能解决你的问题
    By using the Windows API Escape() function, your application can pass data direc
    tly to the printer. If the printer driver supports the PASSTHROUGH printer escape
    , you can use the Escape() function and the PASSTHROUGH printer escape to send na
    tive printer language codes to the printer driver. 
    If the printer driver does not support the PASSTHROUGH printer escape, you must 
    use the DeviceCapabilities() and ExtDevMode() functions instead. 
    Mit der Windows API Funktion Escape() kann man Daten direkt zum Drucker schicken
    .
    Wenn der Drucker Treiber dies nicht unterst黷zt, m黶sen die DeviceCapabilities()
     and ExtDevMode() Funktionen verwendet werden.//  DOS like printing using Passthrough command
    // you should use "printer.begindoc" and "printer.enddoc"Type
     TPrnBuffRec=Record
     bufflength:Word;
     Buff_1:array[0..255] of Char;
    End;//Function DirectToPrinter(S:String;NextLine:Boolean):Boolean;
    var Buff:TPrnBuffRec;
        TestInt:Integer;
    Begin
     TestInt:=PassThrough;
     if Escape(Printer.Handle,QUERYESCSUPPORT,SIZEOF(TESTINT),@testint,nil) > 0 Then
      Begin
       if NextLine Then  S:=S+#13+#10;
       StrPCopy(Buff.Buff_1,S);
       Buff.bufflength:=StrLen(Buff.Buff_1);
       Escape(Printer.Canvas.Handle,Passthrough,0,@buff,nil);
       Result:=True;
      End
      Else
       Result:=False;
    end;
       
      // this code works if the printer supports escape commands
      // you can get special esc codes from printer's manual  {example:
         printer.begindoc;
        try
         directoprinter('This text ');
        finally
         printer.enddoc;
        end;
        }
      

  4.   

    truezerg(赵明宇) 说的对,但是,,等呀,我用PRinter做打印,怎么设置纸张大小?
    我要打印票据的。7个孔的:)
    with printer do begin
            try
             //printer.PageHeight;
             //printer.PageWidth;
             我想在上两行设置,不行。怎么办?
             BeginDoc;
             Canvas.Font.Name:='宋体';
             Canvas.Font.Size:=12;
             Canvas.Font.Style:=[fsBold];
             Canvas.TextOut(160,0,XKZ);
             Canvas.TextOut(320,0,YZH);
             NewPage;
            finally
             EndDoc;