[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 749
  • Last Modified:

Printer escape sequence problem

We've been using a method of changing printer fonts for several years on Solaris 7 but the same script is a problem on Solaris 9.  On Solaris 9 the job prints correctly but continues to print multiple copies until the job is stopped.  Here is the script that we use.

cat begin.txt /group1/tax/CODE1/COLL/C1Ps1.PRNTRPT.report end.txt | lp -dhp5 -t "TAX COLLECTOR CODE1" -o banner

The begin.txt and end.txt files that are concatenated are as follows.  The boxes in this sequence are the escape character in the original file.

begin.txt
E&l1S&l0O&k2S

The being.txt sequence does a printer reset, duplex long edge binding, portrait orientation, and 16.7 characters per inch.

end.txt
&l1TE

The end.txt sequence sends a job separation and a printer reset.

Can anyone point out what is causing this problem or show me a better way of accomplishing this?  

Thanks in advance!
0
davidshockey
Asked:
davidshockey
  • 3
  • 3
  • 2
2 Solutions
 
tfewsterCommented:
Try replacing the encoded escape characters with "\033" (the octal representation of ESC); A PCL printer should recognise the representation and process them properly
0
 
davidshockeyAuthor Commented:
tfewster,

That didn't work.  We got at page that printed the escape codes followed by an incorrectly formatted document.  

But it only printed once! ;-)
0
 
yuzhCommented:
Try to use "-r" with lp to make sure your file is not filtered in any way, eg:

lp -r -dhp5 -t "TAX COLLECTOR CODE1" -o banner
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
tfewsterCommented:
I've just tried this on a Solaris 8 and a Solaris 9 system, and I can't see a difference.

As you said, putting "\033" instead of the Esc character didn't work; Sorry!

Please check that all the "" characters are valid escape characters:

> od -c begin.txt
0000000 033   E 033   &   l   1   S 033   &   l   0   O 033   &   k   2
0000020   S  \n
0000022

> od -c end.txt  
0000000 033   &   l   1   T 033   E  \n
0000010

How are these printers set up? Access directly across a network or going via a  Unix/Windows/print server?
0
 
davidshockeyAuthor Commented:
Apologies for the delay in getting back.  This is a problem that another developer is working on and so you're getting replies filtered thru me.

yuzh,

We tried your suggestion and there was no change in the behavior except that the banner page lists an invalide option: stty=-opost.

tfewster,

We tried the od as you suggested and the only difference that we found was the existence of the newline in your listing.  We placed a newline in our version and tried again... no joy.  

These printers are accessed directly across a network with an external JetDirect device attached to the printer.  There is no print server involved.

One thing I've noticed that I didn't know before is that each copy of the output has its own banner page and there is some time delay between copies.  
0
 
davidshockeyAuthor Commented:
Our SA created a new printer using the JetDirect utility on the Solaris 9 server and guess what... it works just like the old one.  She says that the old one was created in the same way and doesn't see a difference between the two.  

Thanks for the help, I'm splitting the points between you two.
0
 
tfewsterCommented:
Weird - I was testing using a similar environment, and couldn't reproduce the problem. So I was thinking remote print server setups or printer models might be the difference.

I avoided using Jetadmin, I just used lpadmin to ensure I knew exactly what had been set up...

Anyway, glad to hear you've fixed the problem and thanks for the points!
0
 
yuzhCommented:
I never have to use third party package (eg Jetadmin), to setup a printer in Solaris, I have
a lot of HP network printer (with built in NIC), can see any problem between different version of Solaris.  It might have someting to do with your  JetDirect  settings.

and thanks for the points.




0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now