Windows printer interface

The Windows printer interface uses the Windows GDI printer driver (wingdiprinter), which employs BASIC @() function codes to embed character sequences into the print data stream.

The @() function codes allow you to:

  • Create and select graphical objects (such as fonts, pens, and brushes) for use during a print job.
  • Specify the x,y coordinates on the printer page for outputting text, drawing lines or arcs, bitmaps, and drawing or filling rectangles, circles, and polygons.
  • Specify text and background attributes, such as color and extra spacing.

The Windows printer driver always maintains the current x,y coordinate position on the print page. When outputting a line of text ending with a carriage return and line feed, the x,y coordinate position gets adjusted. When the outputting of a line goes beyond the end of the print page, the printer driver automatically ends the current page and advances to the next page.

Note: You can force page advancement by storing a form feed character in the print data stream.

@() function codes 301 - 399 are defined in a control item of the DEVICES file to support the @() function to character sequence translations that the Windows printer driver recognizes for calling the appropriate Windows Printer API methods. Two types of Windows Printer @() function codes are provided:

  • @() function codes 301–339 perform setup tasks in preparation for a print job.
  • @() function codes 340–399 perform the actual printing.
CAUTION:

Although multiple printing @() function codes can be concatenated, do not concatenate a setup @() function code with another setup @() function code or a printing @() function code.

Setup @() function codes should always be isolated in a single statement.

The Windows GDI interface removes <ESC> characters before sending output to the printer. This will virtually disable the use of HP PCL command sequences. See the following sub-topics for guidance on how to use @() function sequences instead of PCL for typeface management, x,y coordinates, and so on.