Printing
Moderators: Susan Smith, admin, Gabriel
-
- Posts: 11
- Joined: Wed Feb 10, 2010 6:35 pm
- Location: Birmingham, Alabama
Printing
I cannot get the following code to change the cpi or lpi on my printer. Any help would be appreciated.
BRConfig.sys---------------------------------------------------------
PRINTER EPSON
SUBSTITUTE PRN:/10 LPT1:
REM NAME=IBM_2391_Plus
printer IBM_2391_Plus INIT LPP 66,"\E@" ! Init using RESET command
printer IBM_2391_Plus [CPI=10],"\EP" ! 10 cpi
printer IBM_2391_Plus [CPI=12],"\EM" ! 12 cpi
printer IBM_2391_Plus [CPI=17],0F ! 17 cpi
printer IBM_2391_Plus [LPI=6],"\E2" ! 6 lpi
printer IBM_2391_Plus [LPI=8],"\E0" ! 8 lpi
REM Screen Colors
SCREEN N 1B,R 31,U 5E,B 9B,H 1E
REM Keyboard
KEYBOARD 0A00,000D0A00 ! so attn works in input
KEYBOARD 1400,0019 ! F20 is HELP
KEYBOARD 0B00,000A00720075006E0020005C00770062005C006D00610069006E006D0065006E0075000D
REM Suppress creation of .BAK files
Option 26
REM Save files as .WB instead of .BR
Option 29
REM Supress Error 6245 Unsupported printer escape sequence
Option 32
REM Send print screen images to a specfic printer.
rem PRINTSCREEN WIN:/SELECT
rem PRINTSCREEN PRN:/SELECT
PRINTSCREEN WIN:/DOT4_001
REM Turn Graphical User Interface OFF
GUI OFF
REM Make Some Graphics available
graphic_linedraw sunken
rem Change C:\BRprint to be accessed as C:\ (BR REQUIREMENT DRIVE SPECIFICATION)
DRIVE C:,C:\BRprint,C:\BRprint,\
Program---------------------------------------------------------------------
00010 ! REPLACE TEST02
00020 !
00030 OPEN #255: "NAME=WIN:/SELECT",DISPLAY,OUTPUT
00040 PRINT #255,USING "FORM C,SKIP 0": "[CPI=10]"
00050 PRINT #255: "12345678901234567890"
00060 PRINT #255: "12345678901234567890"
00070 PRINT #255,USING "FORM C,SKIP 0": "[CPI=17]"
00080 PRINT #255: "12345678901234567890"
00090 PRINT #255: "12345678901234567890"
00100 CLOSE #255:
00110 STOP
BRConfig.sys---------------------------------------------------------
PRINTER EPSON
SUBSTITUTE PRN:/10 LPT1:
REM NAME=IBM_2391_Plus
printer IBM_2391_Plus INIT LPP 66,"\E@" ! Init using RESET command
printer IBM_2391_Plus [CPI=10],"\EP" ! 10 cpi
printer IBM_2391_Plus [CPI=12],"\EM" ! 12 cpi
printer IBM_2391_Plus [CPI=17],0F ! 17 cpi
printer IBM_2391_Plus [LPI=6],"\E2" ! 6 lpi
printer IBM_2391_Plus [LPI=8],"\E0" ! 8 lpi
REM Screen Colors
SCREEN N 1B,R 31,U 5E,B 9B,H 1E
REM Keyboard
KEYBOARD 0A00,000D0A00 ! so attn works in input
KEYBOARD 1400,0019 ! F20 is HELP
KEYBOARD 0B00,000A00720075006E0020005C00770062005C006D00610069006E006D0065006E0075000D
REM Suppress creation of .BAK files
Option 26
REM Save files as .WB instead of .BR
Option 29
REM Supress Error 6245 Unsupported printer escape sequence
Option 32
REM Send print screen images to a specfic printer.
rem PRINTSCREEN WIN:/SELECT
rem PRINTSCREEN PRN:/SELECT
PRINTSCREEN WIN:/DOT4_001
REM Turn Graphical User Interface OFF
GUI OFF
REM Make Some Graphics available
graphic_linedraw sunken
rem Change C:\BRprint to be accessed as C:\ (BR REQUIREMENT DRIVE SPECIFICATION)
DRIVE C:,C:\BRprint,C:\BRprint,\
Program---------------------------------------------------------------------
00010 ! REPLACE TEST02
00020 !
00030 OPEN #255: "NAME=WIN:/SELECT",DISPLAY,OUTPUT
00040 PRINT #255,USING "FORM C,SKIP 0": "[CPI=10]"
00050 PRINT #255: "12345678901234567890"
00060 PRINT #255: "12345678901234567890"
00070 PRINT #255,USING "FORM C,SKIP 0": "[CPI=17]"
00080 PRINT #255: "12345678901234567890"
00090 PRINT #255: "12345678901234567890"
00100 CLOSE #255:
00110 STOP
Your example is "OLD CODE" before the PRINTER.SYS substitutions that are in 4.1X +
In order to use the printer sunstitution features that you are trying to use you need to establish a linkage of printer types to your program and its printer open statement.
This linkage consists of two parts.
1. In the WBCONFIG.SYS file, or a file it refers to using an "INCLUDE filename" statement you specify what printer type each substitution refers to. Generally there are two printer types ,NWP and PCL, although you may have a MATRIX or IBM as well.
rem ***** Apply the NWP substitutions to any printer opened WIN: or PREVIEW:
PRINTER TYPE NWP select WIN:
PRINTER TYPE NWP select PREVIEW:
PRINTER TYPE NWP select PDF:
rem ***** Apply the PCL substitutions to any printer opened PRN:
PRINTER TYPE PCL select PRN:
PRINTER TYPE PCL select DIRECT:
rem ***** Apply the DOT matrix substitutions to any printer opened PANA1123
PRINTER TYPE PANA1123 SELECT PANALBL
PRINTER TYPE PANA1123 SELECT PANAMAIL
The above phrases tell BR what substitution to use if the characters following the word "select" appear anywhere in the printer name of the open statement for the printer.
2. The OPEN statement for the printer specifies the name of the printer or printer class being used. Note that the printer designation may be a strin that is being substitutied for by another phrase such as opening NAME=\\10 when
SUBSTITUTE //10 WIN:/\\PS2C6BA7\P1
has been included in the WBCONFIG.SYS file
In your example you have opened the printer
00030 OPEN #255: "NAME=WIN:/SELECT",DISPLAY,OUTPUT
So in my description above I would need a PRINTER TYPE statement in my WBCONFIG file that refers to something in the name string. I have "WIN:" so BR would use the substitution prameters for PRINTER TYPE NWP.
My PRINTER.SYS file includes the line
PRINTER NWP [CPI=10],"\E(s0p10H" ! 10 CPI
so "[CPI=10]" will be rreplaced in the print stream with CHR$(9)(s0p10H
This is a setting to initiate 10 CPI for a FIXED POSITION font. If the font that I am trying to set is a proportinal font this statement will not affect it because the "H" at the end is a PCL representation for HORIZONTAL sizing of characters per inch where as a proportinal font uses VERTICAL point sizing. The rough correlation of vertical sizing to horizontal sizing is H=120/V or V=120/H so the statement would need to be
PRINTER NWP [CPI=10],"\E(s0p12V"
You could change it to accomplish both by making it
PRINTER NWP [CPI=10],"\E(s0p10h12V"
Note that this is case sensitive, but addresses both fixed size and proportinal fonts in the same statement.
To fix your program you must
a) makes sure that your WBCONFIG file inclused a line with the substitution that you are calling
b) includes a PRINTER TYPE statement that will relate to your printer open NAME=
Hope this helps
FNGeorge
In order to use the printer sunstitution features that you are trying to use you need to establish a linkage of printer types to your program and its printer open statement.
This linkage consists of two parts.
1. In the WBCONFIG.SYS file, or a file it refers to using an "INCLUDE filename" statement you specify what printer type each substitution refers to. Generally there are two printer types ,NWP and PCL, although you may have a MATRIX or IBM as well.
rem ***** Apply the NWP substitutions to any printer opened WIN: or PREVIEW:
PRINTER TYPE NWP select WIN:
PRINTER TYPE NWP select PREVIEW:
PRINTER TYPE NWP select PDF:
rem ***** Apply the PCL substitutions to any printer opened PRN:
PRINTER TYPE PCL select PRN:
PRINTER TYPE PCL select DIRECT:
rem ***** Apply the DOT matrix substitutions to any printer opened PANA1123
PRINTER TYPE PANA1123 SELECT PANALBL
PRINTER TYPE PANA1123 SELECT PANAMAIL
The above phrases tell BR what substitution to use if the characters following the word "select" appear anywhere in the printer name of the open statement for the printer.
2. The OPEN statement for the printer specifies the name of the printer or printer class being used. Note that the printer designation may be a strin that is being substitutied for by another phrase such as opening NAME=\\10 when
SUBSTITUTE //10 WIN:/\\PS2C6BA7\P1
has been included in the WBCONFIG.SYS file
In your example you have opened the printer
00030 OPEN #255: "NAME=WIN:/SELECT",DISPLAY,OUTPUT
So in my description above I would need a PRINTER TYPE statement in my WBCONFIG file that refers to something in the name string. I have "WIN:" so BR would use the substitution prameters for PRINTER TYPE NWP.
My PRINTER.SYS file includes the line
PRINTER NWP [CPI=10],"\E(s0p10H" ! 10 CPI
so "[CPI=10]" will be rreplaced in the print stream with CHR$(9)(s0p10H
This is a setting to initiate 10 CPI for a FIXED POSITION font. If the font that I am trying to set is a proportinal font this statement will not affect it because the "H" at the end is a PCL representation for HORIZONTAL sizing of characters per inch where as a proportinal font uses VERTICAL point sizing. The rough correlation of vertical sizing to horizontal sizing is H=120/V or V=120/H so the statement would need to be
PRINTER NWP [CPI=10],"\E(s0p12V"
You could change it to accomplish both by making it
PRINTER NWP [CPI=10],"\E(s0p10h12V"
Note that this is case sensitive, but addresses both fixed size and proportinal fonts in the same statement.
To fix your program you must
a) makes sure that your WBCONFIG file inclused a line with the substitution that you are calling
b) includes a PRINTER TYPE statement that will relate to your printer open NAME=
Hope this helps
FNGeorge
-
- Posts: 11
- Joined: Wed Feb 10, 2010 6:35 pm
- Location: Birmingham, Alabama
To FNGeorge;
Thanks for responding so quickly to my problem but I do not understand your answers.
1. Where do I find out about printer types MATRIX and IBM ? (Line 7)
2. Would I substitute "PANA1123" with "IBM_2391_Plus" ? (Lines 16,17)
3. What is PANALBL and PANAMAIL ? (Lines 16,17)
4. Where may I find your PRINTER.SYS file ? (Line 28). I found one at ftp.ads.net/Dll_distr/ PRINTER.SYS dated 11/16/2007 but i do not think it is the correct one. It has no PRINTER NWP [CPI=10],"\E(s0p10H" in it. It does refer to PRINTER NWP [10CPI], "\E9s10H" which is not the same.
Thanks in advance,
Gary
Thanks for responding so quickly to my problem but I do not understand your answers.
1. Where do I find out about printer types MATRIX and IBM ? (Line 7)
2. Would I substitute "PANA1123" with "IBM_2391_Plus" ? (Lines 16,17)
3. What is PANALBL and PANAMAIL ? (Lines 16,17)
4. Where may I find your PRINTER.SYS file ? (Line 28). I found one at ftp.ads.net/Dll_distr/ PRINTER.SYS dated 11/16/2007 but i do not think it is the correct one. It has no PRINTER NWP [CPI=10],"\E(s0p10H" in it. It does refer to PRINTER NWP [10CPI], "\E9s10H" which is not the same.
Thanks in advance,
Gary
PRINTER NWP [10CPI], "\E9s10H" is a typo. The SHIFT key was not pressed and the 9 should be ( This string of codes is PCL the BR translates into Native Windows Printing commands. The \E stands for and is replaced by the ESCAPE character.
PRINTER TYPE is a key used by BR to determinw what substitution table to use for the particular printer. BR does this by matchin part of the printer name after the printer is opened to the string that you specify in the SELECT phrase in your CONFIG file.
Attached is the PRINTER.SYS file that I use plus one for the Panasonic and one for the Epson printer escape sequences.
For printing in NWP, which is what your example shows, you would only need the PRINTER.SYS set of substitutions. In your WBCONFIG.SYS you can include this file by simply referring to it with the line
INCLUDE X:\WB\PRINTER.SYS
where X:\WB\ is the path to its location.
PRINTER.SYS already has the PRINTER TYPE statement that you need in it, so just open your printer as WIN:/DEFAULT or PREVIEW:/DEFAULT and you should see the font and lines per inch change from your example program.
(It appears that I can only attach a single file, so I've attached the PRINTE>SYS. If you need the others let me know and I'll send them separately. If you are using NWP then PRINTER.SYS is all you need. If you are printing directly with your own escape codes then we're in a different place.)
FNGeorge
PRINTER TYPE is a key used by BR to determinw what substitution table to use for the particular printer. BR does this by matchin part of the printer name after the printer is opened to the string that you specify in the SELECT phrase in your CONFIG file.
Attached is the PRINTER.SYS file that I use plus one for the Panasonic and one for the Epson printer escape sequences.
For printing in NWP, which is what your example shows, you would only need the PRINTER.SYS set of substitutions. In your WBCONFIG.SYS you can include this file by simply referring to it with the line
INCLUDE X:\WB\PRINTER.SYS
where X:\WB\ is the path to its location.
PRINTER.SYS already has the PRINTER TYPE statement that you need in it, so just open your printer as WIN:/DEFAULT or PREVIEW:/DEFAULT and you should see the font and lines per inch change from your example program.
(It appears that I can only attach a single file, so I've attached the PRINTE>SYS. If you need the others let me know and I'll send them separately. If you are using NWP then PRINTER.SYS is all you need. If you are printing directly with your own escape codes then we're in a different place.)
FNGeorge
- Attachments
-
- printer.sys
- (14.04 KiB) Downloaded 996 times
-
- Posts: 11
- Joined: Wed Feb 10, 2010 6:35 pm
- Location: Birmingham, Alabama
-
- Posts: 11
- Joined: Wed Feb 10, 2010 6:35 pm
- Location: Birmingham, Alabama
To FnGeorge;
Think we are making progress. Here is revised code:
BRCONFIG.SYS--------------------------------------------------------------
PRINTER TYPE NWP SELECT WIN:
PRINTER TYPE PCL SELECT WIN:
PRINTER TYPE IBM_2391_PLUS SELECT PANALBL
PRINTER TYPE IBM_2391_PLUS SELECT PANAMAIL
INCLUDE C:\BrPrint\printer_185.sys
REM Screen Colors
SCREEN N 1B,R 31,U 5E,B 9B,H 1E
REM Keyboard
KEYBOARD 0A00,000D0A00 ! so attn works in input
KEYBOARD 1400,0019 ! F20 is HELP
KEYBOARD 0B00,000A00720075006E0020005C00770062005C006D00610069006E006D0065006E0075000D
REM Suppress creation of .BAK files
Option 26
REM Save files as .WB instead of .BR
Option 29
REM Supress Error 6245 Unsupported printer escape sequence
Option 32
REM Send print screen images to a specfic printer.
rem PRINTSCREEN WIN:/SELECT
rem PRINTSCREEN PRN:/SELECT
PRINTSCREEN WIN:/DOT4_001
REM Turn Graphical User Interface OFF
GUI OFF
REM Make Some Graphics available
graphic_linedraw sunken
rem Change C:\BRprint to be accessed as C:\ (BR REQUIREMENT DRIVE SPECIFICATION)
DRIVE C:,C:\BRprint,C:\BRprint,\
Program--------------------------------------------------------------------
00010 ! REPLACE TEST02
00020 !
00030 OPEN #255: "NAME=WIN:/SELECT",DISPLAY,OUTPUT
00035 ! OPEN #255: "NAME=WIN:/IBM_2391_Plus",DISPLAY,OUTPUT
00040 PRINT #255,USING "FORM C,SKIP": "[CPI=10][6LPI]"
00050 PRINT #255: "12345678901234567890"
00060 PRINT #255: "12345678901234567890"
00070 PRINT #255,USING "FORM C,SKIP": "[CPI=17][4LPI]"
00080 PRINT #255: "12345678901234567890"
00090 PRINT #255: "12345678901234567890"
00100 CLOSE #255:
00110 STOP
---------------------------------------------------------------------------
Any of the 4 PRINTER TYPE statements work.
Either of the program statements 30 & 35 work.
BUT the IBM2391 printer goes to Gothic Font before printing. Hopefully using the Epson escape file (when received) will remedy this.
Please explain how to use printer types MATRIX and IBM.
Please explain what PANALBL & PANAMAIL are and the differences between them. Are their different designations when using printer types MATRIX and
IBM ?
Thanks in advance,
Gary
Think we are making progress. Here is revised code:
BRCONFIG.SYS--------------------------------------------------------------
PRINTER TYPE NWP SELECT WIN:
PRINTER TYPE PCL SELECT WIN:
PRINTER TYPE IBM_2391_PLUS SELECT PANALBL
PRINTER TYPE IBM_2391_PLUS SELECT PANAMAIL
INCLUDE C:\BrPrint\printer_185.sys
REM Screen Colors
SCREEN N 1B,R 31,U 5E,B 9B,H 1E
REM Keyboard
KEYBOARD 0A00,000D0A00 ! so attn works in input
KEYBOARD 1400,0019 ! F20 is HELP
KEYBOARD 0B00,000A00720075006E0020005C00770062005C006D00610069006E006D0065006E0075000D
REM Suppress creation of .BAK files
Option 26
REM Save files as .WB instead of .BR
Option 29
REM Supress Error 6245 Unsupported printer escape sequence
Option 32
REM Send print screen images to a specfic printer.
rem PRINTSCREEN WIN:/SELECT
rem PRINTSCREEN PRN:/SELECT
PRINTSCREEN WIN:/DOT4_001
REM Turn Graphical User Interface OFF
GUI OFF
REM Make Some Graphics available
graphic_linedraw sunken
rem Change C:\BRprint to be accessed as C:\ (BR REQUIREMENT DRIVE SPECIFICATION)
DRIVE C:,C:\BRprint,C:\BRprint,\
Program--------------------------------------------------------------------
00010 ! REPLACE TEST02
00020 !
00030 OPEN #255: "NAME=WIN:/SELECT",DISPLAY,OUTPUT
00035 ! OPEN #255: "NAME=WIN:/IBM_2391_Plus",DISPLAY,OUTPUT
00040 PRINT #255,USING "FORM C,SKIP": "[CPI=10][6LPI]"
00050 PRINT #255: "12345678901234567890"
00060 PRINT #255: "12345678901234567890"
00070 PRINT #255,USING "FORM C,SKIP": "[CPI=17][4LPI]"
00080 PRINT #255: "12345678901234567890"
00090 PRINT #255: "12345678901234567890"
00100 CLOSE #255:
00110 STOP
---------------------------------------------------------------------------
Any of the 4 PRINTER TYPE statements work.
Either of the program statements 30 & 35 work.
BUT the IBM2391 printer goes to Gothic Font before printing. Hopefully using the Epson escape file (when received) will remedy this.
Please explain how to use printer types MATRIX and IBM.
Please explain what PANALBL & PANAMAIL are and the differences between them. Are their different designations when using printer types MATRIX and
IBM ?
Thanks in advance,
Gary
Your two IBM statements are stepping on each other. If your printers that contain "IBM are all matrix printers of similar type then just use one config statement
PRINTER TYPE IBM SELECT PANALBL
The PANALBL and PANAMAIL configurations are my own making because I used to have some Panasonic matrix printers that printed labels for mailings. I have since switched to HP lasers with sheet fed labels.
If you are using NWP printing then the WIN/NWP configurations are the ones that you want to use because you will be printing through the Windows print driver that will convert everything to graphics. If you are printing directly, not through the Windows print driver, then you want the matrix printer substitutions.
I have attached a MATRIX.DRV file that contains the substitutions, BUT you will have to modiffy the TYPE names to match the TABLE name that you reference in your TYPE IBM SELECT statement.
Based on the OPEN statement you are using the NWP substitution table. Since you have not specified a FONT the Windows driver is defaulting a font. Try inserting
00038 PRINT #255:"[FONT ARIAL][SMALL]"
PRINTER TYPE IBM SELECT PANALBL
The PANALBL and PANAMAIL configurations are my own making because I used to have some Panasonic matrix printers that printed labels for mailings. I have since switched to HP lasers with sheet fed labels.
If you are using NWP printing then the WIN/NWP configurations are the ones that you want to use because you will be printing through the Windows print driver that will convert everything to graphics. If you are printing directly, not through the Windows print driver, then you want the matrix printer substitutions.
I have attached a MATRIX.DRV file that contains the substitutions, BUT you will have to modiffy the TYPE names to match the TABLE name that you reference in your TYPE IBM SELECT statement.
Based on the OPEN statement you are using the NWP substitution table. Since you have not specified a FONT the Windows driver is defaulting a font. Try inserting
00038 PRINT #255:"[FONT ARIAL][SMALL]"
-
- Posts: 11
- Joined: Wed Feb 10, 2010 6:35 pm
- Location: Birmingham, Alabama
Renamed file attachment from prior post. DDD isn't allowed either so I'll try TXT
- Attachments
-
- MATRIX.txt
- (7.64 KiB) Downloaded 967 times
-
- Posts: 11
- Joined: Wed Feb 10, 2010 6:35 pm
- Location: Birmingham, Alabama
-- CONCLUSION --
This is what my Brconfig.sys is now. Thanks for all the help.
rem 04/06/2010 Written by: Gary E. Buxton
rem set printer to EPSON mode
rem Programs to use HEX$("2B020500hhvvll") translation
PRINTER EPSON
rem set printer to use table in EPSON.drv = EPSONDOT
PRINTER TYPE EPSONDOT SELECT DIRECT:
INCLUDE C:\BR\EPSON.drv
rem set printer to use table in Printer.sys
rem PRINTER TYPE PCL SELECT PRN: ! BR Default
rem PRINTER TYPE NWP SELECT PDF: ! BR Default
rem PRINTER TYPE NWP SELECT PREVIEW: ! BR Default
rem PRINTER TYPE NWP SELECT WIN: ! BR Default
INCLUDE C:\BR\Printer.sys
REM Screen Colors
SCREEN N 1B,R 31,U 5E,B 9B,H 1E
REM Keyboard
KEYBOARD 0A00,000D0A00 ! so attn works in input
KEYBOARD 1400,0019 ! F20 is HELP
KEYBOARD 0B00,000A00720075006E0020005C00770062005C006D00610069006E006D0065006E0075000D
REM Suppress creation of .BAK files
Option 26
REM Save files as .WB instead of .BR
Option 29
REM Supress Error 6245 Unsupported printer escape sequence
Option 32
REM Send print screen images to a specfic printer.
PRINTSCREEN WIN:/DOT4_001
REM Turn Graphical User Interface OFF
GUI OFF
REM Make Some Graphics available
graphic_linedraw sunken
DRIVE C:,C:\BR,C:\BR,\
This is what my Brconfig.sys is now. Thanks for all the help.
rem 04/06/2010 Written by: Gary E. Buxton
rem set printer to EPSON mode
rem Programs to use HEX$("2B020500hhvvll") translation
PRINTER EPSON
rem set printer to use table in EPSON.drv = EPSONDOT
PRINTER TYPE EPSONDOT SELECT DIRECT:
INCLUDE C:\BR\EPSON.drv
rem set printer to use table in Printer.sys
rem PRINTER TYPE PCL SELECT PRN: ! BR Default
rem PRINTER TYPE NWP SELECT PDF: ! BR Default
rem PRINTER TYPE NWP SELECT PREVIEW: ! BR Default
rem PRINTER TYPE NWP SELECT WIN: ! BR Default
INCLUDE C:\BR\Printer.sys
REM Screen Colors
SCREEN N 1B,R 31,U 5E,B 9B,H 1E
REM Keyboard
KEYBOARD 0A00,000D0A00 ! so attn works in input
KEYBOARD 1400,0019 ! F20 is HELP
KEYBOARD 0B00,000A00720075006E0020005C00770062005C006D00610069006E006D0065006E0075000D
REM Suppress creation of .BAK files
Option 26
REM Save files as .WB instead of .BR
Option 29
REM Supress Error 6245 Unsupported printer escape sequence
Option 32
REM Send print screen images to a specfic printer.
PRINTSCREEN WIN:/DOT4_001
REM Turn Graphical User Interface OFF
GUI OFF
REM Make Some Graphics available
graphic_linedraw sunken
DRIVE C:,C:\BR,C:\BR,\