Operating System - HP-UX
1848300 Members
8488 Online
104024 Solutions
New Discussion

Re: command line printing format problem ( urgent )

 
SOLVED
Go to solution
yyghp
Super Advisor

command line printing format problem ( urgent )

OS: HP-UX 11.11 ( PHCO_29209 loaded )
Printer: Lexmark Network Printer ( Optra SE 3455 )
I setup print queue using SAM.

Now, I can easily use Netscape in HP-UX to print out any HTML file and plain text file successfully, even HTML files with images. And also I can use a Lexmark printer test utility to print out a formatted letter paper with different fonts.
But the problem now is that I have problem to use command line to print out a plain text file in correct format, like the file '/etc/passwd', etc.( I have tried so many pain text files but failed to print out good format paper, and I have to use command line to schedule my printing job )

For example, when i wanted to print out /etc/passwd with: lp -d /etc/passwd
or lp -d -o letter /etc/passwd

root:*:0:3::/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
...

The result I got is: ONLY 1 letter size paper

root:*:0:3::/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:

(NOTE: those s stand for blank, because I don't know how to use real in this forum)
(Only 4 lines were printed, and each line was aligned to the right side, ALL other lines are missing)

So, how to control such printing format in this case ? Is there any good document for HP-UX printing formating ?
Thanks !
12 REPLIES 12
A. Clay Stephenson
Acclaimed Contributor

Re: command line printing format problem ( urgent )

Lexmark has a set of drivers and printer commands that integrate into the lp subsystem. Your first task will be to download/install this package AND download/study the associated manual.
This also allows you to customize the interface files.

http://downloads.lexmark.com/cgi-perl/downloads.cgi?ccs=229:1:0:175:0:0&emeaframe=&fileID=886

Formatting in UNIX is the sole responsibily of the application. I suspect that Netscape is actually printing everything in PostScript.
If it ain't broke, I can fix that.
Gustavo Ferraro
Advisor

Re: command line printing format problem ( urgent )

you have to activate Auto CR/LF on the printer.
to do this use markvision, directly via printer control panel, or put the printer IP address on your browser. Go to PCL emulation menu.

hope this helps.
Gustavo.-
yyghp
Super Advisor

Re: command line printing format problem ( urgent )

I have always downloaded drivers(more than 100MB) and installed in the system before I posted this message. I think if something wrong with the driver, I couldn't use Netscape to print out a very good formated paper, even with images.
I think the problem is that when I use 'lp' to send job to print queue, I don't know how HP-UX control the printing format at this time, that's why i got a bad formated paper.
I think maybe there is a config file which i need to setup properly to define the print format before I can use command line 'lp', or is there any other 'lp' options/parameters which I need to use ?

Thanks !
yyghp
Super Advisor

Re: command line printing format problem ( urgent )

hi Gustavo,

How to use Markvision?
could you please tell me more detail about that ?
Where's control panel ? you mean CDE's ?

Thanks!
yyghp
Super Advisor

Re: command line printing format problem ( urgent )

hi Gustavo,

Another thing is that I can use my windows Notepad to print out plain text file( like readme.txt ) to that printer without any format problem.
Geoff Wild
Honored Contributor

Re: command line printing format problem ( urgent )

I would remove the printer (with SAM), then recreate it using the lexprt utility:

The Lexmark driver package must be installed first.

The file to download from http://drivers.lexmark.com/ is DRIVERS-HPUX1X.PKG.Z

uncompress it then swinstall it.

It will install "Lexmark Enhanced Printer Drivers Package" and "Lexmark Screen Fonts Package". After completion, run: /opt/lexmark/setup.print (use the default of bin for Administrative group, and install fonts as an additional font directory.

Then use /usr/bin/lexprt program to add queues.


Rgds...Geoff



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: command line printing format problem ( urgent )

Actually Netscape would print to a Remote printer without the Lexmark Drivers. It would simply send Postscript as raw data and that would work just fine. Remote printers are very limited in their formatting abilities. Network printers are not. The first clue that you were not doing this correctly was adding the printer using SAM. Lexmark provides a utility called 'lexprt' to add printer. Use that. Again, download and study this manual, it will guide you through the process.
ftp://ftp.lexmark.com/driver/unix/Drivers/docs/drivers-userguide.pdf
If it ain't broke, I can fix that.
yyghp
Super Advisor

Re: command line printing format problem ( urgent )

I have tried to install the package before, and added queue using lexmark's utility, but the problem is that when i tried to print out a text file, even its test paper, it didn't work, no paper coming out, and the print queue was been disabled !
I could see the error message via using 'lpstat -t' that:
Messsage: disabled by scheduler, Printer interface script returned non-zero exit status
And the print queue can't be enabled !
I got a solution for this error message from Lexmark's website(that's a bug), which asked me to download one file called "marknet_model" from Lexmark's website and replaced the queue interface file "/usr/spool/lp/interface/".
Unfortunately, no progress, same error !
Unless I used SAM to create a queue, which replaced that interface file "/usr/spool/lp/interface/", then I can print out good formatted documents via Netscape or Lexmark's utility, but got bad formatted paper while using command line 'lp'.
Gustavo Ferraro
Advisor
Solution

Re: command line printing format problem ( urgent )

Hi,

Markvision is a printer managment software from Lexmark. It's free, and come with the drivers CD of almost every Lexmark printer {or you can download from www.lexmark.com}. With markvision yo can control, setup and configure several network printers in remote way.
By Control Panel I means the physical panel on the printer.
I guess you have trouble with "raw line printing" because "lp" command does not format the output nor uses PCL/PS commands to "accomodate" the printing. It sends plain text to the printer. Instead Notepad, Netscape uses printer driver to format the output, with apropiate print control commands to format the output.

Gustavo.-
yyghp
Super Advisor

Re: command line printing format problem ( urgent )

Hi A. Clay,

I read that PDF 2 weeks ago, I tried to use Lexmark's utility to install the driver, but it didn't work, even haven't printed out any paper :(
Please read my message above...

BTW, my Lexmark printer is Network printer, not remote printer...
Something strange is that there is no option in SAM to config non-HP network printer, so, I used "remote printer" from menu to create a new queue, and it worked, just can't print out good formatted paper via commmand line...

Any suggestion for this ?
yyghp
Super Advisor

Re: command line printing format problem ( urgent )

Thank you very much Gustavo Ferraro !
You are right !!!!!!!!!!!
After I went to the physical printer and changes the setting in PCL EMUL MENU for CR/LF ( turned them to ON ), I can now successfully print out a formatted plain text file !
Victor_101
Regular Advisor

Re: command line printing format problem ( urgent )

Hi guys ,
i have the same problem on a HP Laserjet 5Si printer and I could not find the LF-CR option to turn it on..I found that this is a problem of missing filters... that the carriage return does not also send the next line to the first column ... but since this printer is a network printer.. i was wondering even if i find this LF-CR option ,will turning it on affect my other users printing from windows.. what do i do ?
if this is the only solution where is this option on the laserjet 5

thanx