Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Send special escape sequence directly to the printer

edited January 2002 in General
Is it possible to send some raw text, embedded near the beginning of the
generated file to be print ?

What I need is to send some PCL escape sequences to the printer to set an
internal font and send characters for that font. Maybe I will have to return
to a standard font after.

I don't have an equivalent Windows font. Only a SIMM or DIMM inserted in the
laser printer.

What the third-party document says is that the data must be assembled and
sent to the printer. The placement of this data in the print stream should
be just after the page definition commands and before the printed text
begins.

Thanks.

_Jocelyn_

Comments

  • edited January 2002
    We are not very familiar with sending escape sequences. It is possible to
    use escape sequences, as one customer we know of is using them to print a
    reports in their entirety. The Report.OnEndPage event is the event in which
    the page object is completed by the report engine, and just before it is
    sent to the output device (printer).


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Ok, but how to manipulate the "page object" ? Any property, any buffer. Is
    it still in a ReportBuilder format, or now in the output device format ?

    _Jocelyn_


  • edited January 2002
    The page object is just a regular delphi object, an instance of TppPage
    containing a list of TppDrawCommands. The page object is sent to a
    ReportBuilder device class, such as the TppPrinterDevice. The printer
    device uses the page objects (namely, its draw commands) to draw on the
    printer's canvas within the BeginDoc and EndDoc of the print process. I'm
    not sure when the best time to use an escape sequence would be, but I'd
    guess that you'd want to modify your version of the RB source
    (RBuilder\Source\ppPrnDev.pas), to provide the capability to add an escape
    sequence when a page is received by the device. Perhaps, place a custom
    text draw command descendent on page in the OnEndPage event. Then the
    printer device, could detect the text of this special draw command class.
    The device could interpret the draw command such that it should install a
    special font via escape sequence and print the text in the draw command
    usign that font. The device could then continue with the rest of the page
    as normal.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.