Printer Initialization Statements

From Br Wiki
Jump to: navigation, search

CAUTION - Although BR bypasses the Windows print drivers (but not the selection routines), Windows often initialized printers in some strange ways. So you should use the PRINTER INIT config statement to initialize your printers the way you expect them to be, when running under Windows.

set specific: PRINTER PRN:/10 INIT hexcodes - to - reset - printer

set default: PRINTER INIT hexcodes - to - reset - printer

The BRCONFIG.SYS PRINTER statement syntax has been expanded to relate a Windows printer description with a printer type referenced by subsequent PRINTER statements. An example of its use is:

                                NT style printer names
==========================
PRINTER TYPE HPLASER  SELECT   Mary's HP Laser@43NE
PRINTER TYPE EPSONDOT SELECT   Main Server Wide Plain@29TD
printer HPLASER INIT LPP 66,"\E&k2G\E(s10H\E&l6D\E&l0O" ! Init to 10 CPI, 6 LPI, Portrait
printer HPLASER LPP 66 [ COLS=80],"\E(s10H"        ! 10 CPI
printer HPLASER LPP 66 [ COLS=96],"\E(s16.66H"     ! 16.66 CPI
printer HPLASER LPP 66 [ COLS=100],"\E(s16.66H"    ! 16.66 CPI
printer HPLASER LPP 66 [ COLS=120],"\E(s16.66H"    ! 16.66 CPI
printer HPLASER LPP 66 [ COLS=132],"\E(s16.66H"    ! 16.66 CPI
printer HPLASER LPP 51 [ COLS=158],"\E(s16.66H\E&l1O"    ! 16.66 CPI Landscape
printer HPLASER LPP 51 [ COLS=170],"\E(s16.66H\E&l1O"    ! 16.66 CPI Landscape
printer HPLASER [ RESET+],"\E(s10H\E&l6D\E&l0O"          ! Reset all prior settings
printer HPLASER [ LEGAL],"\E&l3A"          ! start printing on legal size paper
printer HPLASER [ LETTER],"\E&l2A"         ! start printing on letter size paper
printer HPLASER [ COLS=224],"[COLS=224] IS INVALID"      ! Not Possible
printer HPLASER [ CPI=10],"\E(s10H"       ! 10 CPI
printer HPLASER [ CPI=12],"\E(s0p12H"     ! 12 CPI N/A
printer HPLASER [ CPI=17],"\E(s16.66H"    ! 16.66 CPI
printer HPLASER [ LPI=6],"\E&l6D"         ! 6 Vertical LPI
printer HPLASER [ LPI=8],"\E&l8D"         ! 8 Vertical LPI
printer HPLASER [ BOLD+],"\E(s3B"         ! Set Bold
printer HPLASER [ BOLD-],"\E(s0B"         ! Cancel Bold
printer HPLASER [ DW+],                   ! Set Double Width N/A
printer HPLASER [ DW-],                   ! Cancel Double Width N/A
printer HPLASER [ LQ+],                   ! Set Letter Quality N/A
printer HPLASER [ LQ-],                   ! Cancel Letter Quality N/A
printer HPLASER [ ITALICS+],"\E(s1S"      ! Set Italics
printer HPLASER [ ITALICS-],"\E(s0S"      ! Cancel Italics
printer HPLASER [ PS+],"\E(s1P"           ! Set Proportional Spacing
printer HPLASER [ PS-],"\E(s0P"           ! Cancel Proportional Spacing

REM   NAME=EPSONDOT Epson Wide Carriage Dot Matrix & Compatibles
printer EPSONDOT INIT LPP 66,"\E@"                 ! Init using RESET command
printer EPSONDOT LPP 66 [COLS=80],12"\EP"          ! 10 CPI
printer EPSONDOT LPP 66 [COLS=96],12"\EP"        ! 10 CPI
printer EPSONDOT LPP 66 [COLS=100],12"\EP"       ! 10 CPI
printer EPSONDOT LPP 66 [COLS=120],12"\EP"       ! 10 CPI
printer EPSONDOT LPP 66 [COLS=132],12"\EP"       ! 10 CPI
printer EPSONDOT LPP 66 [COLS=158],"\EM"           ! 12 CPI
printer EPSONDOT LPP 66 [COLS=170],0F              ! 17.1 CPI
printer EPSONDOT LPP 66 [COLS=224],0F              ! 17.1 CPI
printer EPSONDOT [RESET+],"\E@"                    ! Reset all prior settings
printer EPSONDOT [LEGAL],                  ! START PRINTING ON LEGAL SIZE PAPER
printer EPSONDOT [LETTER],                 ! START PRINTING ON LETTER SIZE PAPER
printer EPSONDOT [CPI=10],12"\EP"       ! 10 CPI
printer EPSONDOT [CPI=12],"\EM"           ! 12 CPI
printer EPSONDOT [CPI=17],0F              ! 17.1 CPI
printer EPSONDOT [LPI=6],"\E2"            ! 6 Vertical LPI
printer EPSONDOT [LPI=8],"\E0"            ! 8 Vertical LPI
printer EPSONDOT [BOLD+],"\EE\EG"         ! Set Bold (Emphasized+Enhanced)
printer EPSONDOT [BOLD-],"\EF\EH"         ! Cancel Bold
printer EPSONDOT [DW+],0E                 ! Set Double Width
printer EPSONDOT [DW-],14                 ! Cancel Double Width
printer EPSONDOT [LQ+],"\Ex1"             ! Set Letter Quality
printer EPSONDOT [LQ-],"\Ex0"             ! Cancel Letter Quality
printer EPSONDOT [ITALICS+],"\E4"         ! Set Italics
printer EPSONDOT [ITALICS-],"\E5"         ! Cancel Italics
printer EPSONDOT [PS+],"\Ep1"             ! Set Proportional Spacing
printer EPSONDOT [PS-],"\Ep0"             ! Cancel Proportional Spacing

The preceding example would permit the program to specify PRN:/SELECT or PRN:/DEFAULT in place of PRN:/10, and after the printer was selected the appropriate printer init string would be executed. To do so, BR would tie the lengthy multi-word Windows printer description to the appropriate printer type and escape sequence.

BR PERMITS ANY MATCHING SUBSTRING after the SELECT keyword, so the following would also work:

PRINTER TYPE HPLASER  SELECT   Mary's
PRINTER TYPE EPSONDOT SELECT   Main

Descriptions that follow SELECT:

  • are case sensitive.
  • can be a substring (part of name).
  • are matched against the OPEN Name= value.
  • if no Name= match then matched against the selected printer name.

Printing in BR can be accomplished in a number of ways. A print job can be written to a file and then "copied" to a printer either programmatically or through the BR SPOOLCMD function. Alternatively BR can send the print job "DIRECTLY" to the printer by specifying the printer name. Or BR can use the services of the Windows(r) printer driver through NWP (Native Windows Printing). The use of NWP allows BR to provide a preview display of the print file, however NWP does not support all of the HP PCL coding that can be implemented by DIRECT printing when the print job is directed to a PCL compliant printer.

See also: SPOOLCMD, PAGEOFLOW, and Error Conditions