Operating System - HP-UX
1834007 Members
1804 Online
110063 Solutions
New Discussion

Re: HP-UX lp command can't print PS file

 
SOLVED
Go to solution
Freddie C
Advisor

HP-UX lp command can't print PS file

I have setup a jetdirect printer on a HP-UX 11i machine using HP Jetdirect Printer Installer. All hppi diagnostics tests pass and I can also print both text and PS files using hpnpf command. However, with the lp command, I can only print text files. When trying to print PS files with lp, I will see a "Processing data..." status on my printer and after a while, it goes into Ready mode with no printouts. Are there any configurations I should check?
10 REPLIES 10
whiteknight
Honored Contributor

Re: HP-UX lp command can't print PS file

Freedie

You can use ghostscript to print.

http://hpux.cs.utah.edu/hppd/hpux/PostScript/ghostscript-8.56.0/

I think lp command may not support postscript

WK
Problem never ends, you must know how to fix it
Peter Nikitka
Honored Contributor

Re: HP-UX lp command can't print PS file

Hi,

generally, the lp command of course supports PostScript.
- Is it the same file you try via hpnpf and lp, which fails for lp?
- what is the type of the JetDirect printer - is it really capable to print PS files?
- what does the command 'file ' tell?
- I think, there is a test under hppi, which can send testfiles of type PS to the printer
- What is the configured mode of the printer: PCL, PS, Auto?

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Freddie C
Advisor

Re: HP-UX lp command can't print PS file

I did already try printing the same file through hppi's diagnostic test print specifying User supplied file as well as through hpnpf and both succeeded in printing the PS file. That means the printer is capable.

'file' returns 'postscript file -version 2.0'

Configured mode of printer is set to Auto. Tried setting to ps but it didn't help.
Freddie C
Advisor

Re: HP-UX lp command can't print PS file

man page says that the lp command queues files for printing. /var/adm/lp/log showed the job submitted through lp is then processed by hpnpf.

Thanks for the ghostscript suggestion though.
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX lp command can't print PS file

It depends upon the current interface file for the printer located in /var/spool/lp/interface/myprinter. There will also be a "myprinter" secondary script in the model.orig directory just below the interface directory. Typically, you need to add the -o postscript argument to the lp command.

lp -dmyprinter -o postscript myfile.pl

but the exact -o arguments depend upon the interface file and whether or not someone has customized the script from its original form. Most HP supplied interface files have a -o options argument that will print the arguments or direct you to a man page.

echo "Test" | lp -dmyprinter -o options.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: HP-UX lp command can't print PS file

Since you are using hppi, I am assuming you have an HP printer. The hpnpf command simply sends the file to the printer so if PS works OK, the printer is Postscript-capable and recognizes the PS code correctly.

So the problem is in the printer script. Now I have never seen lp say: "Processing data..." and that string is not present in any of the hppi printer scripts or the lp command. This makes the lp command quite suspicious. What do these commands report:

type lp
what /usr/bin/lp

Is it an alias? Do you have a wrapper for the lp command?


Bill Hassell, sysadmin
Peter Nikitka
Honored Contributor

Re: HP-UX lp command can't print PS file

Hi,

@Bill:
reading the original post carefully, I else noticed just now
>>
I will see a "Processing data..." status on my printer
<<

So the data really goes to the printer - if no other user is currently printing, no paper is used for the print job. This remembers me to generated PostScript code, which missed a 'showpage' command.
Though you told us about the hpnpf:
If you submit the identical file to another PS printer - is the result OK?

mfG Peter


The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Bill Hassell
Honored Contributor
Solution

Re: HP-UX lp command can't print PS file

Sorry, I missed the detail about "on my printer". This means that the printer script has modified the print slightly with some automatic code in the script. Verify this by printing with:

lp -dmyprinter -oraw myPostscriptFile.ps

If this is OK, then the script is not appropriate for the printer. Try copying the generic net_ljx000 to the printer's script location:

cp /opt/hpnpl/sh/net_ljx000 /etc/lp/interface/model.orig/myprinter

Try again. Printer scripts look intimidating but are quite simple in the way they work. You can replace the printer script anytime that printer is idle.


Bill Hassell, sysadmin
skt_skt
Honored Contributor

Re: HP-UX lp command can't print PS file

i often use and that works

#lp -dqname postfile
what does "hpnpadmin -i QIPADDRESS" says.
what is the printer model?what is the current model script used?

ll /etc/lp/interface/qname
ll /etc/lp/interface/model.orig/qname
Freddie C
Advisor

Re: HP-UX lp command can't print PS file

G'day folks, the replies have been really helpful in resolving my problem.

In summary -

*Clay: -o postscript doesn't work for me but the `echo "Test" | lp -dmyprinter -o options` was a good pointer. The printout states to see the man page for my printer script (never thought the script would come with a man page :) ) From the man page, I see that I can parse the option "-o ps3" and that worked! This is one lead, tells me it only works with Postscript level 3.

*Peter: Sorry, it's the only PS printer I got on hand.

*Bill: -oraw doesn't work but -o raw generated this error:
===Start of printout===
ERROR: undefined
OFFENDING COMMAND: @PJL

STACK:
===End of printout=====

Your tip to replace the script in the model.orig is great. The current one has been modified by hppi. I replaced it with the original printer script for my printer and it worked! I can now use the lp command to print the postscript file without using options.

The printer script still looks intimidating to me so I just took a diff of the hppi-modified and original scripts. The original script sets PSLEVEL="2" while hppi for some reason modified this to PSLEVEL="3". Now it struck me why I needed to use the "-o ps3" option with the hppi-modified script.

The strange thing is that when PSLEVEL="3", I will not be able to change this option through hppi. With PSLEVEL="2", I can only set it to 1 or 2 through hppi. I decided to just edit the hppi-modified script to set PSLEVEL="2".

*Santhost: Fyi, "hpnpadmin -i QIPADDRESS" reports:
Printer Description:
--------------------
MFG :HP;
MDL :HP Business Inkjet 2800;
CMD :MLC,PCL5,PCLXL,PML,PJL,POSTSCRIPT,DYN;
CLS :PRINTER;
DES :HP Business Inkjet 2800;

Printer ID :4866

Thanks for all your great replies!