Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 11th October 2002, 00:36
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
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
    Code:
    pfont14=\E&f0s1y2x1S,
  • 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
    Code:
    before.program:
    	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
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 20:31.
Reply With Quote
  #2  
Old 5th August 2003, 15:58
lvdvelde's Avatar
lvdvelde lvdvelde is offline
Member
 
Join Date: May 2002
Posts: 42
lvdvelde is on a distinguished road
Baan: B4c4, ERP Ln, WebTop, WorkTop, WorkSpace, ION - DB: Oracle 10g, Oracle 11g - OS: AIX 5.3, Linux
Logos / Preprinted Forms printing

Hey Vamsi,

I have this all working perfectly - different overlays for the first page and every next page, including logo's, header and footer.
Except for the linespacing - the Baan report has only 42 lines.

Did you learn anything yet on how to fix that?

Greetings, Lex
Reply With Quote
  #3  
Old 5th August 2003, 17:08
lvdvelde's Avatar
lvdvelde lvdvelde is offline
Member
 
Join Date: May 2002
Posts: 42
lvdvelde is on a distinguished road
Baan: B4c4, ERP Ln, WebTop, WorkTop, WorkSpace, ION - DB: Oracle 10g, Oracle 11g - OS: AIX 5.3, Linux
Got it!

Hi again,

just found out how to get the right linespacing.

In the beginning of the generated OVL file, you will find the following escape sequence:

\E&l 4d 1e (HEX 1B 26 6C 34 64 31 45)

This says: 4 lines per inch, top margin of 1 line.

When you change that to - say - 7 lines per inch, it looks a lot more like a Baan report.

\E&l 4d 1e (HEX 1B 26 6C 37 64 31 45)

Have fun!

Lex
Reply With Quote
  #4  
Old 5th August 2003, 18:18
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Lex,

I am glad someone is using the solution. This is one thread that I contributed to Code & Utilities that never got any response :).

Could you post a sample pdf document for people to see what is possible without investing big dollars.
__________________
~Vamsi
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.
Reply With Quote
  #5  
Old 6th August 2003, 22:28
lvdvelde's Avatar
lvdvelde lvdvelde is offline
Member
 
Join Date: May 2002
Posts: 42
lvdvelde is on a distinguished road
Baan: B4c4, ERP Ln, WebTop, WorkTop, WorkSpace, ION - DB: Oracle 10g, Oracle 11g - OS: AIX 5.3, Linux
Talking une petite erreur

dumdumdum...

the escape sequence for the correct linespacing should look like:

\E&l 7d 1E (HEX 1B 26 6C 37 64 31 45)

you can view the attached PDF for the result.
Header and footer including text and logos are the overlay macro, the printed data (customer address, items amounts etc.) is the Baan report data.

-- off the record - I had to construct the PDF in MS Word, because the overlay is printed as a file directly to any HP printer..... not to something like a PDF printer. But I swear our Baan output looks exactly the same! :-)

Lex

Last edited by lvdvelde : 4th October 2010 at 15:12.
Reply With Quote
  #6  
Old 7th August 2003, 12:43
rupertb's Avatar
rupertb rupertb is offline
Senior Member
 
Join Date: Jun 2002
Location: NY, USA
Posts: 192
rupertb is on a distinguished road
Baan: T2.2, BIVb2, BIVc4, Vc - DB: Oracle, INFORMIX, DB2, SQL - OS: AIX, WIN
Vamsi sometimes you've just got to modify those proverbs...

Quote:
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."

New 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 -
Give him a rotten fish and he'll probably never bother
you again!"


Great solution - now I've got to find an application for those overlays...

Regards,
Rupert
Reply With Quote
  #7  
Old 20th August 2003, 18:56
baanbab baanbab is offline
Member
 
Join Date: Apr 2002
Location: San Diego, CA
Posts: 42
baanbab is on a distinguished road
Baan: Baan IVc4 - DB: SQL 7.0 - OS: Windows 2003/XP
line spacing problem

Hi

I tried the print a report based on vamsi's posting. It worked but I still had the line spacing problem after changing the escape sequence in OVL file.

Can you please post the OVL file which has printed with proper lince spacing.

Thanks,
Babu
Reply With Quote
  #8  
Old 25th August 2003, 19:00
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Babu,

Please post your OVL file.
__________________
~Vamsi
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.
Reply With Quote
  #9  
Old 28th October 2003, 07:18
sant123's Avatar
sant123 sant123 is offline
Member
 
Join Date: Mar 2002
Location: USA
Posts: 77
sant123 is on a distinguished road
Baan: B4C4 - DB: Oracle9i - OS: AIX 5.2
Having probelm getting it to work

Vamsi,

I went through the same steps described in your posting, still having no luck getting it to work. one thing I noticed was I got the the error when I tried to run the statement lp -dprintque -oraw -s ${BSE}/lib/barcode/font/logo.ovl from unix shell, I got the error, I wish I could connect to office and give you the right error message, I would try that tomorrow.

we have IBM unix AIX4.3.3. Baan4c4.

all I need is to print logo on the sales invoice, your complex idea looks really good ( since i don't have to mess around with the client PCS).

One other thing, there was no folder by name fonts underneath barcode folder, all the printer drive files are under $BSE/lib/printinf/h(for hp)/ folder.

Help.
Reply With Quote
  #10  
Old 28th October 2003, 21:16
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Quote:
lp -dprintque -oraw -s ${BSE}/lib/barcode/font/logo.ovl
That command sends the overlay to the printer. If are going to run it at the command prompt you will have to expand the environment variable ${BSE}. Make sure that the lp command for you os is what you have quoted.
__________________
~Vamsi
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.
Reply With Quote
  #11  
Old 4th November 2003, 00:46
sant123's Avatar
sant123 sant123 is offline
Member
 
Join Date: Mar 2002
Location: USA
Posts: 77
sant123 is on a distinguished road
Baan: B4C4 - DB: Oracle9i - OS: AIX 5.2
Problems.

Vamsi,

This is what I am trying to do. I would like to print invoice with the company logo on it and email it to the customers.

we have the Novell Groupwise email system, I have problem using mailx or sendmail command from AIX4.3.3 ( this is where Baan 4c4 is installed), so I gaveup on the email part. now I want atleast have the logo printed on the invoice and send the report to the Microsoft word ( Baan standard soln) and save the report on the client pc and manually e-mail it to the customer as the attachement.

I tried all the three types:

1. html format, it changes the page length, but I could use it.
2. Client side solution, ( create font and open it in BWprint ) the problem how would I email it ?? so this is not the solution.
3. your solution seems the good one, where I don't need to do anything on the client side, but if I send it to the word document does it still add the logo to the report.

Thanks for any help.

also the error I get when I do lp -d the error is as follows.

0782-040 Cannot open print file.
The file name is raw
The errno (error number) from the open system call is 2
Check the file name specified with your print request.
<EOT>
Reply With Quote
  #12  
Old 4th November 2003, 01:27
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
You left me boggled. I am not sure I understand if you want to print the invoice or email it.

This solution works as follows:
- An overlay of the logo is created
- This is then transferred to the printer
- A standard Baan report is printed to this printer with code to activate the overlay. In effect printing the logo on the invoice.

You can then *mail* this invoice to the customer, but not *email* it.

What part of the above is causing a problem? If you want to talk about this solution send me an email and I will send you my phone number.

If you are creative you can use the Vanilla PDF solution I posted in this forum to generate PDF, overlay a logo on each page and email the resulting file. Sounds complex - perhaps it is.

For an out of box solution to add a logo to an invoice and then email it in a single step, look to www.nazdaq.co.il.
__________________
~Vamsi
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.
Reply With Quote
  #13  
Old 4th November 2003, 06:20
sant123's Avatar
sant123 sant123 is offline
Member
 
Join Date: Mar 2002
Location: USA
Posts: 77
sant123 is on a distinguished road
Baan: B4C4 - DB: Oracle9i - OS: AIX 5.2
Boy did I messup!!!!

I tried to give as much details possible and made it quite complicated.

I understand your solution creates the print file with the overlay logo, but could not be used as the attachement that could be sent as an email.

I would try to look into the PDF creation tool.

I would still email you to get the overlay print problem solved. I didn't get the logo printed, I used the User Font 13 in my case since 14 is already used for some other report. couldn't get it to work.

Thanks.
Sant.
Reply With Quote
  #14  
Old 18th March 2004, 20:50
shah_bs's Avatar
shah_bs shah_bs is offline
Guru
 
Join Date: Jan 2002
Location: Lewisville, Texas
Posts: 387
shah_bs is on a distinguished road
Baan: BAAN IVc3 with A&D2.2b - DB: ORACLE 9 - OS: HPUX
${BSE} does not expand

Hello people.

This is under BAAN IVc3 and HPUX: I found that, the command as suggested for the report script does not expand the ${BSE}. So, here is what I did:

Code:
before.program:
        domain  tcmcs.long      p.ret.c
        domain  tcstr.128.c     p.command.c

        p.command.c = "-d"
                      & tolower$(spool.device)
                      & " -oraw -s "
                      & bse.dir$()
                      & "/lib/barcode/font/LOGO.OVL"

        p.ret.c = run.prog(
                        "/usr/bin/lp",
                        p.command.c,
                        RP_WAIT)
And that worked.
Reply With Quote
  #15  
Old 18th March 2004, 23:14
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
Shah could you please improve the documentation based on your experience. Either use this thread or start your own in Wiki.
__________________
~Vamsi
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Forms morpheus Tools Development 9 23rd January 2003 14:36


All times are GMT +2. The time now is 12:15.


©2001-2017 - Baanboard.com - Baanforums.com