Operating System - HP-UX
1828235 Members
2197 Online
109975 Solutions
New Discussion

Unable to modify the print queue.

 
SOLVED
Go to solution
Jagadesh_2
Regular Advisor

Unable to modify the print queue.

Hi,
I am trying to modify the printqueue in HP-UX 11i. The print queue is created for a remote printer HP Laserjet III.

When i try to modify the printqueue
# modifyqueue -q clynel_1 -b off
Could not modify the queue !
The print scheduler is also running. Kindly let me know how to modify this.

Thanks in advance
S.Jagadesh
10 REPLIES 10
Bill Hassell
Honored Contributor

Re: Unable to modify the print queue.

Is the printer truly a remote printer (not installed by hppi)? If so, the JetDirect software (modifyqueue, addqueue, etc) will not work. Everything in the /opt/hpnpl/bin directory is for HP printers that use JetDirect cards.

It can be really confusing looking at SAM for adding printers. The term "remote" means that the printer is connected to a server (WinNT, Win2k, WinXP, Linux, Sun, etc) and does not have an HP JetDirect interface card or external box. The other type of printer is a "network" printer which refers exclusively to HP JetDirect interface cards and boxes and the queue can be modified by either hppi or modifyqueue.


Bill Hassell, sysadmin
Jagadesh_2
Regular Advisor

Re: Unable to modify the print queue.

sorry Bill, I had given wrong information in the call. It is a network printer.
Jagadesh_2
Regular Advisor

Re: Unable to modify the print queue.

Hi Bill,
I have recreated the printqueue using hppi with banner setting off. Now i am facing a new problem, that all print out's are printed one line down from where they should be (e.g. Place and date is getting printed in the Signature Box).

Bill Hassell
Honored Contributor

Re: Unable to modify the print queue.

This will take some extra work to resolve. The first task is to try the printout with the banner page on. Use lp -oyb -dprintqueue your_file, or if your application doesn't allow any options to lp, use modifyqueue to turn the banner on again. If it works, the issue is with the printer script but it will be tricky to find. There is likely an extra LF somewhere at the start when no-banner is turned on.

The alternative is to insert a reverse line-feed code into the script which will move the text up--however, this assumes that your print job is plain ASCII, Courier font, and has no XY coordinates hardcoded into the printout.


Bill Hassell, sysadmin
Jagadesh_2
Regular Advisor

Re: Unable to modify the print queue.

Hi Bill,
I fired a print using
#lp -oyb -dprintqueue filename the same went fine.

How to insert a reverse line-feed code into the script which will move the textone line up.

I am using the print script /opt/hpnpl/sh/net_lj4x .I cannot directly modify this script as some of printers are configured to use this. Can i copy the script to /opt/hpnpl/sh/net_lj4xtest with reverse line feed modification and assign the same to that printer. Will that solves the issue?

Thanks
S.Jagadesh
Bill Hassell
Honored Contributor
Solution

Re: Unable to modify the print queue.

The code is ESC&-1R which is: escape-character & minus number-one capital-R. You are correct: do not modify the template directory in /opt/hpnpl/sh. When hppi or addqueue creates a new printer, a copy of the appropriate printer script is copied from the template directory to /etc/lp/interface/model.orig with the same name as the printer. This script is always associated with the printqueue so customizing it is the correct way to modify it.

Insert this code:

echo "\033&-1R\c"

The string says: \033 (octal 033 which is the escape character), &-1R to perform a reverse line feed (technically, it is a vertical motion command where -1 can be -2.33 or +1.2 or any value to move the current position) and finally, \c which suppresses the automatic line feed from the echo command (don't want to undo what we just accomplished).

Insert this echo around line 3761 where it says: cooked) (you can find this by running vi, type G (go to end of file) then ?cooked which searches backwards for cooked. Insert the echo just after the existing escape sequence: echo "\033&k2G\c"


Bill Hassell, sysadmin
Jagadesh_2
Regular Advisor

Re: Unable to modify the print queue.

Thanks for the information Bill,

When i checked for the model script in /etc/lp/interface/model.script/clynel_1 the required entry is already available.

Pasting that part below.
*******************************
?cooked
;;

cooked)
echo "\033&k2G\c"
if [ "$pescfile" = "yes" ]
then
sed "s/$esc//g" "$file" | sed 's/\\033//g' | cat
else
*******************************
I checked the same in /opt/hpnp/sh/netlj4x. The entry is available in this file too.
Jagadesh_2
Regular Advisor

Re: Unable to modify the print queue.

Hi Bill,
Sorry. That entry is not available.

Thanks
S.Jagadesh
Bill Hassell
Honored Contributor

Re: Unable to modify the print queue.

Here is the original code:

cooked)
echo "\033&k2G\c"
if [ "$pescfile" = "yes" ]

and here is how it should be modified:

cooked)
echo "\033&-1R\c"
echo "\033&k2G\c"
if [ "$pescfile" = "yes" ]



The task is to insert the echo just before the print job is sent to the printer. Note that this is not a complete solution if you use other options such as -orelay. This fix is just for a simple lp command.


Bill Hassell, sysadmin
Jagadesh_2
Regular Advisor

Re: Unable to modify the print queue.

Thanks Bill.
The problem is resolved.