CONTACT US Phone: (412) 835-9417 Email: sales@vss3.com |
TIP #10B HP LASER GRAPHICS with filePro®
RECIPE FOR HP LASER GRAPHICS ON FILEPRO FORMS Part 2
By Wally Turnbull
Date: Sat, 14 Feb 1998 15:07:40 -0500
At last .... Continued from Part 1 - HP Laser Graphics
This second half to the Recipe for HP Laser Graphics on Filepro Forms retraces and fills in a bit of detail from the previous posting.
7b. Use your favorite Windows program to create a form to be
filled-in from your Filepro database ex: myform.cdr. Use any graphics, including embedded
bitmap images such as photographs or logos. Use only printer resident fonts in your form to keep the file size small. (You could set "Print TrueType as Graphics" from Printer Setup in Windows Control Panel for fancy fonts and extra file size.) |
8. Add an HP-III (for example) printer driver to your Windows setup. I sugguest this as it is perhaps the most universally accepted among HP and HP compatible laser printers. |
9. Print to a file - ex: mymacro1.pcl using the HP-III printer selection. |
10. Edit the file created in #3 above using a text editor which does not
add or replace any of the printer codes embeded in the file. DOS Edit and the old MSWord
for DOS are examples of such editors. Most of the Windows word processors will interpret
some of the embeded printer codes as formatting commands and will change your form even if
you save it as a text only file. If your results don't work as described here, you should suspect that your editor changed the file when it saved it back to disk. Edit the beginning of that file (ex: mymacro1.pcl , replacing all the escape commands up to the resolution command which is <Esc>*t300R for 300dpi etc. with the following commands, or the appropriate replacement PCL commands depending on your needs: |
Command Description
------------------------------------------------------ <Esc>&f1Y (macro id #) - replace '1' with desired macro# <Esc>&f0X (start macro) <Esc>&f0S (push cursor - save start position for Filepro) <Esc>&l0O (portrait) <Esc>&l1C (1/48 increment vertical motion index) <Esc>&l2A (letter size paper - must precede margins) <Esc>&l10E (Top margin 10x1/48ths) <Esc>&l1H (Use paper tray auto feed) |
11 Edit the end of the PCL file. Remove the form feed and the reset <Esc>E commands inserted at the very end by most software. | |
12 Replace those removed commands by the following - or those appropriate for your form. | |
Command Description
------------------------------------------------------ <Esc>&f1S (pop cursor position back to Filepro's top left margin) <Esc>&l0E (Top margin 0 from here) <Esc>&a0L (Left margin 0 from here) <Esc>(10U (PC set font) <Esc>(s0P (fixed space font) <Esc>(s12V (12 point font) <Esc>(s0S (upright characters ) <Esc>(s0B (medium density) <Esc>(s3T (courier font) <Esc>&l6D (6 lines per inch) <Esc>&f1X (stop macro) <Esc>&f10X (make macro permanent) |
|
The edited file is now a valid laser printer macro. It is convenient to save the file with the number of the macro used as part of the name for easy reference. Example: mymacro1.mac |
USE THE MACRO
13. Add print code(s) to your laser printer code table to
call your macro(s) (These print codes do not take a space.) <Esc>&f01y3X will execute macro #1. Change ^ 1 to the macro number you used. |
14. Insert the Filepro printer code to call the macro as the first character on your report. |
15. Define the rest of the Filepro form with the fields positioned to print where you want them on the sheet. |
16. Copy the file to the printer as binary ex: copy /b myform5.mac prn Note: You only need to copy the form to the printer once. (Set a global variable flag.) The size of the file will be deducted from the laser printer's available memory. |
17. Print your report from Filepro - either Dclerk or Dreport. The graphics form will be printed with the FilePro data form filled in place. This may seem like a lot of steps but they are only required when the form is created. After that you only copy the form to the printer and use it. |
OTHER NOTES
The method described here is for a graphic image which overlays the Filepro form page starting at the upper left corner and always prints in the same location. By varying the macro initialization commands, it is possible to define the graphic image so that it prints relative to where it is called. This second method would print a signature, for example, right after the last data line, no matter how many data lines there are.
To use proportional fonts for Filepro variable data in Filepro forms it is convenient to have some vertical and horizontal printer "cursor motion" codes defined in the printer table to allow you to place Filepro information where you want to on the form. These commands allow you set where FilePro data will be printed in spite of variable length fields.
Remember to always return the font to 10cpi Courier 12 before calling a column location since you mean - go to this column - "in the current font."
This will do that: $1b ( 10 U $1B ( s 3 t 12 v p s b 10 H
Other useful HP LaserJet commands include:
Command/Code Description |
$1b = : 1/2 line feed forward $1b & a -1 R $1b = : 1/2 line feed backward $1b & a -1 R : Reverse line feed $1b & l 6 D : Set line spacing to 1/6" $1b & l 8 D : Set line spacing to 1/8" $1b & a 20 C : * Locate col 20 (4up) $1b & a 30 C : * Locate col 30 (3up) $1b & a 40 C : * Locate col 40 (2up) $1b & a 50 C : * Locate col 50 (3up) $1b & a 60 C : * Locate col 60 (4up) $1b & a + 1 6 V : * Down_16_Points $1b & a + 2 0 V : * Down_20_Points $1b & a + 2 4 V : * Down_24_Points $1b & a - 1 6 V : * Up_16_Points $1b & a - 2 0 V : * Up_20_Points $1b & a - 2 4 V : * Up_24_Points |
I have listed these print table commands in a clear and easy to change format. You can use whichever base you prefer.
NOTE: In the codes, <ESC> is represented in hex as $1B. In any printcode in filePro, the code $1b is always used in place of <ESC>.
This is the second installment. Wally will add new information as his schedule permits. We will add them as tips #10 A-Z a primer for Laser Printers.
Our thanks to Wally for his submission.
By Wally Turnbull who can be found at wally@tbull.com
This tip posted on February 19, 1998 by Nancy Palmquist. Your comments and suggestions are gratefully accepted. If no one is reading this, I will direct my efforts elsewhere, so let me know if you are finding this helpful. I will be looking for topics that can be covered in a page or two to use for future tips.