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

Sending control characters to a printer

edited November 2004 in Devices
Hello,

How can I send some control characters to a printer from Report Builder? The
printer have continuous paper and after each label the printer have to cut
of this label.
The printer have a scissor to cut of the paper, the question is how to
activate this scissor.

Regards,

Hanjo Willems
iSOFT Nederland B.V.

Comments

  • edited November 2004

    1. You can use the Report.Printer.Canvas.Handle to access the printer device
    context. According to the Windows API documentation, the ExtEscape function
    allows applications to access capabilities of a particular device that are
    not available through GDI. Try searching the Windows API docs and Google for
    more information. We do not have any direct experience with sending escape
    codes directly to the printer driver.

    2. The other approach is to use the Widnows DevMode structure to control the
    printer. See the following article.

    -------------------------------------------------
    Tech Tip: Configuring Printer Specific Options
    -------------------------------------------------

    The Report.PrinterSetup properties can be used to set the properties that
    are common to all printers. Internally RB applies these to the Windows
    DevMode structure.


    Report.PrinterSetup <----> Windows DevMode <-----> Printer Driver <--->
    Printer


    Printers often contains additional features, such as output bins, media
    types, etc. The Windows DevMode structure can contain a private area that is
    used the printer driver to store printer specific options. These can be
    configured by using the Printer Driver's built-in properties dialog. These
    options can theoritically be set programmatically, the trick is that you
    have to know where in the structure to store the option and what values are
    valid.

    The following example shows how to display the printer properties dialog and
    save the devmode for use within RB...

    http://www.digital-metaphors.com/tips/SavePrinterDevMode.zip


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com






    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.