February 1998: Bringing up a Printer in dL4 for Windows


*NOTE: This article has been superseded by "Configuring a Printer for dL4 for Windows".

Many developers moving to dL4, and more specifically Windows 95 and NT, are faced with learning some differences between UNIX and Windows. One of the questions fielded by the Support Department frequently is, "How do I set up a dL4 printer file in Windows?"

The following sequence of steps will guide developers in creating a printer batch file for the first time in the Windows environment. Each step of this sequence depends on the previous step working correctly.

1. Create your printer definition file (printer.def). A good starting place for a first time test is the printer definition from "dL4 Installation & Configuration Guide for Windows 95/NT". This printer definition file is a working, minimal definition that will output the default character set for your printer.

[OutputMacros]
Default=%@%c
[OutputUnicodeMapping]
; This mapping is set up for 8-bit output on a printer using
; the ISO 8859-1 (i.e. ANSI Latin 1) character set.
Set0=
0x0000-0x00ff=0x00

2. Test the printer definition from the MS-DOS prompt:

a) create a temporary test file:
copy con: testfile
test^Z

b) This command will copy your printer definition to the file "testfile" through the pfilter utility. You will be able to do a file compare (fc) between the two files to check the results. If there are any errors, pfilter will show them on the screen. On ONE LINE, type:

type c:\dl4\printers\printer.def | c:\dl4\pfilter c:\dl4\printers\printer.def -d testfile

3. Check the printer attachment to MS-DOS / Windows from the MS-DOS prompt: This command will copy your printer definition file to the printer device through the pfilter utility. If there are any errors, pfilter will show those errors on the screen. On ONE LINE, type:

type c:\dl4\printers\printer.def | c:\dl4\pfilter c:\dl4\printers\printer.def -d \\server\printer
-- OR --
type c:\dl4\printers\printer.def | c:\dl4\pfilter c:\dl4\printers\printer.def -d lpt1:

4. Create the printer batch file (printer.bat). Create this file as a one line file from the previous step. The data in the file is the command after the pipe (|) symbol.

c:\dl4\pfilter c:\dl4\printers\printer.def -d \\server\printer
-- OR --
c:\dl4\pfilter c:\dl4\printers\printer.def -d lpt1:

NOTE: A printer batch file cannot have the same name as a MS-DOS device such as CON, NUL, LPT1 and PRN. The extension of the file must be ".BAT". The batch file must be in a directory specified in the PATH environment variable.

5. Test the batch file using a small basic program. The following will work for most purposes:
10 Open #1,"$printer.bat"
20 Print #1;"just something to print"
30 Close #1
40 Stop

6. Retest the batch file from a different directory, using the Step 5 basic program, to make sure your PATH environment variable is set correctly. The batch file must be in a directory specified in the PATH environment variable.

When your printer definition and batch files pass this hurdle they are ready for primary installation testing.

7. Add the printer script option for character set. The available character sets are listed in the "dL4 Installation & Configuration Guide for Windows 95/NT." Both the "REM" statement in the batch file and the pfilter line must contain the same character set. This example is using dL4's native character set, utf-8.

\rem dL4opts=charset=utf-8
c:\dl4\pfilter -c utf-8 c:\dl4\printers\printer.def -d \\server\printer
-- OR --
rem dL4opts=charset=utf-8
c:\dl4\pfilter -c utf-8 c:\dl4\printers\printer.def -d lpt1:

8. The printer lock option is primarily for non-spooled printers or printers that could have a clash in data being printed. In this case the addition of ",lock=true" on the "REM" line will turn on the locking mechanism for these printers.

For further documentation on printer batch files and their pipe files refer to the "dL4 Installation & Configuration Guide for Windows 95/NT."


support@dynamic.com
800.822.2742
949.215.1200