Direct LPT port Printing

edited June 2010 in Devices
Can you print direct to an LPT port with ReportBuilder?

RB 11 Server / Delphi 2007.



  • edited June 2010
    Hi Jon,

    What exactly are you trying to accomplish? ReportBuilder uses the Windows
    API to communicate with the printer driver which in turn communicates with
    the printer itself. It is possible to manually send ESC commands to the
    printer using the TppPCL class provided in the ppPCL.pas file.

    Perhaps a little more information on your project will help us understand
    how to help.


    Nico Cizik
    Digital Metaphors

    Best Regards,

    Nico Cizik
    Digital Metaphors
  • edited June 2010
    Direct printing to the port is to support bar code printers. The ESC
    codes need to go direct to the port without any additional formatting.

    We have done this in the past by using the MODE command to redirect the
    LPT port to the serial port and printing direct to the LPT port where it
    ends up on the serial printer.

    Using the windows print driver bypasses the mode command redirect.

  • edited July 2010

    RB 11 introduced support for sending printer commands directly to the
    printer. Windows calls these escape commands.

    The Printer.SendEscape method can be called from the
    Report.OnDeviceStateChange event. And a TppPCL command library includes
    simple to use commands. Example:


    The Report.OnPrinterDeviceStateChange event fires while sending pages to the


    procedure Form1.ppReport1OnPrinterDeviceStateChange(Sender: TObject;
    aStateChange: TppDeviceStateChangeType);
    if (aStateChange = dsAfterStartPage) then
    ppReport1.Printer.SendEscape('some escape code here');


    Nard Moseley
    Digital Metaphors

    Best regards,

    Nard Moseley
    Digital Metaphors
This discussion has been closed.