View Single Post
Old 10th October 2002, 23:36
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Logos / Preprinted Forms printing

Logos / Preprinted Forms in Baan

Complexity = High
This Project is Abandonware. Use at your own risk!
While a few people have been able to make it work and use it, many have questions that do not receive answers. So do not proceed any further unless you are brave.

Note that this will work only in the following environment:
  • Baan installed on Unix
  • HP or compatible printers (most laser printers are!)

Old Chinese proverb:
"Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed him for life."

So here are the various resources that help you catch your own fish :)
  • Peter Hamilton's HP PCL Laser Overlay creation utility
  • This is the software that I used from the above site
  • Improved version of Peter Hamilton's software. No binaries - you will need a compiler
  • In trying to write this document, I hit upon a goldmine. Click here, to join hpdevelopersolutions program as an affiliate member (for free ;-) Then go to developer kits, laserjets, printer languages, PCL 5 to download technical manuals

Steps to follow:
  • Download Peter Hamilton's program
  • Unzip contents into a single folder
  • Install a printer with following settings
    1. Local Printer
    2. Port = File
    3. Manufacturer = HP
    4. Printer = HP Laserjet III
    5. Name = Overlay Printer
    6. Set as Default = No
  • Create the letterhead / form in your favourite Windows program
  • Print to "Overlay Printer".
  • Save the output to "logo.prn" in the same directory that you unzipped the contents of Peter Hamilton's software
  • Open a MSDOS shell. Navigate to the directory where the program and logo.prn are located
  • execute the command "ovl logo.prn logo.ovl"
  • Open LOGO.OVL in a hex editor and traverse to the end of the file. Find the string "&f1s1x10x4X". In that string replace the last small 'x' with a capital 'X'. And the '4X' with NULs (ascii zero). So the final string should look like "&f1s1x10X<00><00>"
  • put LOGO.OVL on your Baan server, say in ${BSE}/lib/barcode/font folder
  • Modify the printer driver associated with your printers to include the following line
  • The 1 in the 1y is the macro number, which is an option that one can specify when using ovl. The default is 1. If you choose to use a different number, make sure they are in sync
  • Do not forget the comma at the end of the line. This is very important
  • In the report that you need the logo in put the below code in the report.script
    	long	ret
    	ret = run.prog("/usr/bin/lp", "-d" & tolower$(spool.device) & 
    		" -oraw -s ${BSE}/lib/barcode/font/LOGO.OVL", RP_WAIT)
  • Create a field on the report with print expression of " ", domain tcmcs.str1 and user font 14

If you are still with us at this point, a report you print to the printer should have a logo on it.

Known issues:
At this point this does not correctly get the linespacing. I am assuming that there are linespacing commands in the generated OVL file or that it resetting the existing values to some arbitrary value. Please update this thread on how to fix that.

If you find this too complex, then go for a forms package. There are plenty of them out there. I use Streamserve. Other options like Jetform exist. The above process can be made easy by buying tools to create and generate the PCL overlay. Please use your good friend Google for that.
Vamsi Potluru
Baan XL Yet another tool to format Baan output in Excel from Baan Board
This one just happens to be free :)

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.

Last edited by ~Vamsi : 6th June 2008 at 19:31.
Reply With Quote