Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network printers configuration

Status
Not open for further replies.

printtek

IS-IT--Management
Jul 12, 2006
7
US
I have some Brother printers, HL2450DN, setup to print using TCP/IP from openserver 5.0.7. I can print from our database and pages print in all the correct formats. i.e. page length, fonts etc. When I print directly from the O/S the page lengths and orentation are not correct. Any tips would be great.
 
Check the printer interface file. It should help you determine which options can be passed along with your "lp" command.
The location of the file is most likely here:
/usr/spool/lp/admins/lp/interfaces/{printer-name}
or here:
/usr/spool/lp/admins/lp/interfaces/model.orig/{printer-name}

If the printer is configured using LPR/LPD, then you should find an entry in /etc/printcap. I believe this method allows you to specify a filter for job control, but I have no first-hand experience in that area.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
In the /usr/spool/lp/admins/lp/interfaces/{printername} you might want to add the option -N at line 75:
if $REALMODEL "$@" | $HPNPF -x $PERIPH -N 2> $LOG > /dev/null

This option takes care for CR/LF when printing directly from the OS.

In /usr/spool/lp/admins/lp/interfaces/model.orig/{printername} you can add the options for your font, lines, etc.
Options can be found by: man lp.

Good luck.

Greetz, Wim. Please remember, The Netherlands is in a different timezone.
 
Will this affect forms printed from the database?
I am using some escape sequences for page length and orientation in the init lines in the database.
 
Maybe we need to know what you wish to print. You can embed codes in the interface file to cause the printer to behave pretty much any way you'd like. If your application starts off it's own codes with a printer reset (Esc-E for PCL5), then those jobs will probably continue to print correctly.
Changing the orientation and font would be straight-forward. You also mentioned controlling forms length. That needs further explanation.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Okay the first thing I found was an incorrect setting on the printer. Auto skip was deselected. I am not sure what this does but once selected the pages of a multipage plain text file end at the proper page length according to the printer settings.
Next will be to tackle different orientations. We are migrating from serial to networked printers. I will give an example of the command being sent for a serial printer.
lp -dTEXT_P4 -o"landscape c lpi8 tl60"
This changes the output of the file to landscaped, compressed, lines per inch = 8, text length 60.
This works great for a serial interface. Not so good with the network interface.
 
When the printer was configured on a serial port, your interface file was located here:
/usr/spool/lp/admins/lp/interfaces/TEXT_P4
Now that the printer has been converted to a networked printer, the same interface file *might be located here:
/usr/spool/lp/admins/lp/interfaces/model.orig/TEXT_P4
That interface file is responsible for handling your formatting options ( -o"landscape c lpi8 tl60" ).

* What utility did you use to create the spooler entry for this network printer? Do you know if you are using HPNP, NETCAT, or LPR?

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
motoslide:

I used scoadmin>printers>Printer Manager>Printer>Add Remote>

Then I used HP Network Printer Manager.
Here are the details of the configuration file.
# pwd
/var/spool/lp/admins/lp/printers/TEXT_P3
# more configuration
Banner: on
Content types: simple
Device: /dev/null
Interface: /usr/spool/lp/model/laserjethpnp
Printer type: unknown
Number of banners: 0
The HPNP, NETCAT, or LPR question. I believe HPNP. How do I tell?
 
I believe you are using HPNP. The file named /usr/spool/lp/admins/lp/interfaces/TEXT_P3 is probably the HPNP script, which starts off like this:
Code:
#!/bin/sh
#
#       @(#) hpnp.model 62.2 97/03/03
#
# $Header: hpnp.model,v 1.9 91/11/14 10:44:35 pma Exp $
#
#       Copyright (C) 1991-1997 The Santa Cruz Operation, Inc.
#               All Rights Reserved.
If that is the case, your active printer interface file is below that directory and is named "./model.orig/TEXT_P3". That file is probably a copy of
/usr/spool/lp/model/laserjethpnp
This is a text file you can read. Does it appear to handle the optional parameters you are passing? If not, you should be able to drop the old interface file you WERE using on top of this file. For clarity, the file you need to review and/or replace is:
/usr/spool/lp/admins/lp/interfaces/model.orig/TEXT_P3.


"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top