Integrating UnForm with BBx

Top  Previous  Next

 

BBx handles printers via alias lines in a configuration file, typically called config.bbx.  Printer alias lines identify a name, an output designation, a description, and several mode options.  To incorporate UnForm into the configuration file on a UNIX system, you need only include an UnForm command line as part of the output designation.

 

BBx output designations can specify files, physical devices, or pipes, and UnForm can be installed to work with any type of definition.  Note that any escape sequences configured in modes like PTON, SP, and CP are sent to UnForm and therefore need to be PCL sequences.  UnForm understands how to strip a job of PCL codes, but not other printer codes.  In some cases, when UnForm sends a job straight through without enhancements, these PCL sequences will also be passed on.

 

UNIX Aliases

 

A printer alias line on UNIX generally pipes to a program, such as the uf90c client program.  This client program in turn can pipe its output to the spooler, or to a file, or it can instruct the server to handle the output from its end, by specifying the –o option.

 

Here is a sample alias line that pipes through UnForm to the local spooler:

 

alias P1 "|uf90c -f my.rul  | lp -dxyz –oraw -s 2>/dev/null" "Printer Name" … various modes

 

Here is a sample alias line that instructs the server to print the job to its spooler.  The advantage of this type of configuration is that the client doesn't have to wait for the job to finish.  It submits the job to the server and exits quickly.

 

alias P1 "|uf90c -f my.rul  -o \'>lp -dxyz –oraw\'" "Printer Name" … various modes …

 

Note the use of the –oraw option in the above examples.  It is important for UnForm's output to be handled as binary data by the spooler.  The –oraw option is used by some UNIX spoolers, such as the SCO LaserJet model script, and the CUPS printing system.  Other spoolers require different options, such as "-o-dp" for AIX, –T pcl for Unixware, -b for some older Linux installations.  Check your lp configuration tools or man pages for the appropriate settings for options such as "binary", "raw", or "pass-thru" printing.

 

UnForm can also print directly to a device, as in this example:

 

alias P1 "|uf90c -f my.rul  -o /dev/lp0" "Printer Name" … various modes

 

Note that this line will behave differently with the UnForm pipe than without.  When opening and sending output directly to a device, printing will occur immediately, without closing the device.  However, with the pipe to UnForm, the output will not appear until the device is closed.  The application may need to be modified to account for this if UnForm is to be used in this circumstance.

 

 

Windows Alias Lines

 

Under Windows, where pipes are not available, change the printer definition to create a file, and then use a post-processing mode, called EXECOFF, to execute UnForm with options to read the file and output to a device.

 

alias P1 C:/TEMP/P1.TXT "UnForm Printer" CR, LOCK=C:/TEMP/P1.LCK, O_CREATE, SPCOLS=132, SP=1B451B287331362E3636481B266B3247, EXECOFF="uf90c.exe -ix C:/TEMP/P1.TXT -o device -f my.rul"

 

In the above example, a file called P1.TXT is created, using the mode O_CREATE to create the file if it doesn't exist, and using a lock file to prevent two users from writing to the same file at the same time.  Note that if a file is specified with a local workstation path, such as C:\\P1.TXT, then a lock file is probably unnecessary.  Just remember to specify the same path in the –ix option.  Once the printer is closed by the application, the code specified by the EXECOFF mode is executed, which runs UnForm as an executable, using the P1.TXT file as input and the printer as output.

 

Note that pathnames containing backslashes will need double backslashes, due to the way BBx parses the command line.  For example, to refer to "uf90c.exe -i c:\data\p1.txt ...",  you would need to specify "uf90c.exe -i c:\\data\\p1.txt ...".  You can also use forward slashes in place of backslashes, and you don't need to double them.

 

The device in the –o argument can be one of two things:

An LPTn port, which can be mapped to a UNC device name with the Windows "net use" command.
 
A UNC device name, defined by sharing a printer, so the name becomes //system/printer, where system is the system with the shared printer, and printer is the "share name" of that printer.

Another variety of alias line can generate a temporary PDF file and display it on the client PC, assuming you have an Adobe Acrobat Reader installed.  This alias doesn't require a –o argument, but will honor it as the client-side file name for the PDF document generated.  The driver selected by the –p option must be either win or winpvw, like this:

 

alias PUNF C:/TEMP/PUNF.TXT "UnForm Printer" CR,LOCK=C:/TEMP/PUNF.LCK,O_CREATE,SPCOLS=132, EXECOFF="uf90c.exe -ix C:/TEMP/PUNF.TXT -p winpvw -f my.rul"

 

 

Note that the uf90c client software must be installed locally on any workstation that will execute it to submit jobs.

 

BBj Client and Server Modes

 

BBj can create/open files and run EXECOFF programs on either the server or the client.  To force one or the other use "client,clientexec" or "server,serverexec" options in the alias line, per the Basis documentation for BBj.  Be sure to use both options together so the file that the execoff program needs is where the execoff program runs.  Remember that where the EXECOFF runs, the UnForm client must be installed or accessed via a network path.