Rich Kijanka
22nd August 2001, 20:10
Has anyone developed or modified a Baan application such as the invoice printer or purchase order printer to access a specific paper drawer in a laser printer. The reason I ask is as follows:

There is a single HP laserjet printer with 2 paper drawers. One drawer would contain paper stock for printing of invoices. A second drawer would contain paper stock for printing purchase orders. The stock in each drawer contains paper that have very specific terms and conditions of business. The invoice drawer would have stock that have terms and conditions for invoices printed on the back and the purchase order drawer would have stock that have terms and conditions for purchase orders.

My question is that if you execute the Baan Invoice printer how can you instruct the printer to draw stock from the drawer that contains the invoice stock ?

The same would apply to the purchase order printer. The output would be directed to the same printer but we want to pull the purchase order stock from the second drawer.

If anyone has done this, or has any thoughts on how this can be done, please let me know.

Regards
Rich Kijanka

tootsie
14th August 2002, 03:22
Hello Rich,
I don't know if you are still looking for a solution.
It is relatively simple to accomplish this an also if you want to print a report in landscape or change the standard lettertype. Changing the initialisation setting of the printerdriver and defining a new printer in Baan does the job.

For changing the drawer on an HP Printer:

Login as user bsp
Go to directory $BSE/lib/printinf/h for drivers HP printers

Make a copy of the file $BSE/lib/printinf/h/hp_lj4 to $BSE/lib/printinf/h/hp_lj4_2

Open this file with VI or another editor

The standard initialisation settings of the printer are unter the heading "Setup" in the the file $BSE/lib/printinf/h/hp_lj4

############################################################################################
# Setup
############################################################################################
initpr=\EE\E&126a66F\E(12U)\E(s10H)\El5H\E(s)p10h0s0b4099T\E&k11.6H,

Change the code El5H in the $BSE/lib/printinf/h/hp_lj4_2 file to El1H and the second drawer will be selected.

Initpr will the look like this:
initpr=\EE\E&126a66F\E(12U)\E(s10H)\El1H\E(s)p10h0s0b4099T\E&k11.6H,

Then save this file as $BSE/lib/printinf/h/hp_lj4_2

Now got to session ttaad3100m000 and make a copy of the printer You are using in Baan with CTRL c.
Rename Device 1 into 1B and change the driver in hp_lj4_2
See screenprints

now for printing of sales invoices use printer 1,
for printing purchase orders use printer 1b


ttaad3100m000 begin set single-occ (1) Form 1-1
R,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,T
. Devices muteren .
5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Device : 1 .
. Omschrijving : HP Laserjet 4 portrait .
. Type printer : Direct .
. Locale : ISO-8859-1 Western Europe - 8 bit .
5,,Printer ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Driver : hp_lj4 .
. Programma : lp -c -ddumb_1 -n%d -s %s .
. Papiertype : A4 A4 format .
. Linker marge : 0 Formfeed : Nee .
5,,Bestand ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Driver : .
. Programma : .
. 4GL-Programma : .
. Argument : .
. Pad : .
. Wijzigen toegest.: .
. Bladlengte : 0 .
. Uw keuze: .. .
F,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,G


ttaad3100m000 single-occ (1) Form 1-1
R,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,T
. Devices muteren .
5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Device : 1B .
. Omschrijving : Hewlett Packard LaserJet 4 briefhoofd .
. Type printer : Direct .
. Locale : ISO-8859-1 Western Europe - 8 bit .
5,,Printer ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Driver : hp_lj4_2 .
. Programma : lp -c -ddumb_1 -n%d -s %s .
. Papiertype : A4 A4 format .
. Linker marge : 0 Formfeed : Nee .
5,,Bestand ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Driver : .
. Programma : .
. 4GL-Programma : .
. Argument : .
. Pad : .
. Wijzigen toegest.: .
. Bladlengte : 0 .
. Uw keuze: .. .
F,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,G

For printing landscape make a copy of the file $BSE/lib/printinf/h/hp_lj4 to $BSE/lib/printinf/h/hp_lj4_lndsc
and change to the bold code.
############################################################################################
# Setup
############################################################################################
initpr=\EE\E&l1o5.45c26a66F\E(12U)\E(s10H)\El1H\E(s)p10h0s0b4099T\E&k11.6H,


ttaad3100m000 single-occ (1) Form 1-1
R,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,T
. Devices muteren .
5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Device : 1L .
. Omschrijving : Hewlett Packard LaserJet 4 Landscape .
. Type printer : Direct .
. Locale : ISO-8859-1 Western Europe - 8 bit .
5,,Printer ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Driver : hp_lj4_lndsc .
. Programma : lp -c -ddumb_1 -n%d -s %s .
. Papiertype : A4 A4 format .
. Linker marge : 0 Formfeed : Nee .
5,,Bestand ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
. Driver : .
. Programma : .
. 4GL-Programma : .
. Argument : .
. Pad : .
. Wijzigen toegest.: .
. Bladlengte : 0 .
. Uw keuze: .. .
F,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,G

You can do the same for printing landscape from drawer 2 making a printer 1L2 with driver hp_lj4_2_lndsc.

Hope this helps you.

Henk

lsatenstein
5th September 2002, 21:45
To select the printer tray you have to include somewhere, the tray select code. To determine the tray select code, visit the web site of your printer manufacturer and download the printer command language. HP uses pcl, as do many other printer companies (Brother, etc).

Modify the header layout for the report form, or if there is no header, insert a header.1 with the tray select code embedded therein.

You may have to add another after.report layout to reset the printer tray to the default value.

It is not wise to set a printer reset command, as this command can reset the printer to power on defaults immediately, and hence you would/could lose the current page being printed.