Simple E-Forms Overlay via the Unix Print Driver
(some knowledge of Unix printing required)
(Skip this section if you aren't worried about why we are doing the things specified in the following section)
Applications which run on Unix or Linux use the standard Unix "printer interface" files to add printer specific control codes to generic print data (the "print job") from applications. These files are actually executable scripts that are called to format the data and send it on to the Unix printer (on CLS this is shown on the left side of the Printer Setup screen) which is connected to a physical port somewhere. We can get the "overlay e-Forms command" control code to the printer by adding a line in these scripts that tells it to "print" that command to the printer with each print job. This will cause every print job sent to that printer interface to be overlaid with that e-Form.
If the developers of the application were forward thinking enough to make it possible to set up a separate printer interface for each printer and for each report that could be printed on that printer. So, for example, a printer called fdlas7 (the 7th LASerjet printer at the Front Desk) might be connected to a port also called fdlas7 and might have printer interface files called fdfol7, fdcls7 and fdreg7 (the 7th FOLio, City Ledge Statement and REGistration printers at the Front Desk) Any print jobs sent to these interfaces, end up printing to the same printer, but the jobs can be formatted in different ways appropriate to the type of form they are being printed with.
Step by Step
Log in to the Unix command prompt as the root user.
Make a backup copy of the printer interface file by typing
cp followed by the name of the interface file for the
report and printer you are setting up e-Forms on then a space then that name
again with .bak after it and press the Enter or
Return key. e.g.
Type vi followed by the name of the interface file for
the report and printer you are setting up e-Forms on and press the
Enter or Return key. e.g.
Press the down arrow until you find the part of the program that looks like this:
# # Loop through all the files passed, for the number of copies specified # copy=1 while [ $copy -le $copies ] do for files in $files do cat /temp/soj.$user.$job $file /temp/eof.$user.$job | /opt/hpnp/bin/hpnpf -x $printer -N copy=`expr $copy + 1` done done
position the cursor on the "o" of the second "do" (the one under "for files in $files"), make sure Caps Lock is off and press the "i" key without holding Shift. The text "--- insert ---" will be displayed at the bottom of the screen.
Move the cursor one character to the right (so that it is after the "do") and press the Enter or Return key.
Press Tab or space keys until the cursor is just above the "c" in "cat /temp...". Use the Backspace key to backup if you make a mistake.
Notice that the quote key used here is the single quote that slants. It is usually on the upper left most key on the keyboard along with the ~ symbol. The letter before the 33 is a zero rather than an "o". The letter before the "y" is a number one rather than a lower case "L". The case of the letters is important; the f, y and c must be lowercase and the X must be uppercase. It is also possible to confuse the forward and backward slash characters; the correct one is usually not the one on the question mark key but rather the one on the key with the "|" symbol.
Press the Esc key to make the "--- insert ---" at the bottom of the
screen disappear and then type
You should see a message like
Now exit the command prompt and return to the application. When you print a job to that printer, the PCL command will be sent with each page and if the e-Form device is installed in the printer, and has that form available, the e-Form will now print. Even without the e-Forms installed, the printer will simply realize that the form is not available and ignore the command.
To test that these codes are correctly entered, change the \033 to \043 (the "+") and print a page (make sure you are using the correct terminal and printer) you should see +&f21y4X for the Folio (or +&f31y4X for the statement, etc...) printed on the first line of the report. Then change the \043 back to an \033 without deleting any of the other codes, and this text should no longer print. This shows that the sequence is being interpreted as a command, rather than printable text, by the printer. The fact that the sequence disappears indicates that it is most probably entered correctly.
Once the e-Form's are working correctly, you should probably go back and
delete the backup files with the commands:
Copyright ©2019 Electronic Forms Plus, Inc., 43537 Ridge Park Dr., Suite #106, Temecula, CA 92590