• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1020
  • Last Modified:

Solaris 2.6 and 7 printcap and printers.conf entry

For both the Spac and Intel version 2.6 and 7, is there an entry that I can put in the printcap or printers.conf file to get rid of the dreaded Staircase effect when printing.  I've written shell scripts to take care of this, but I'm looking for an easier way.  This is a remote printer and I don't have access to the remote system, only the printer.  Also worth noting, the printer does not have a setting to set lf->cr/lf.  I'm looking to do the conversion berfore the job is sent to the remote system.  For HP, I modified the rmodel interface script, but HP's printing system is different from Solaris.  
  • 7
  • 3
  • 3
  • +2
1 Solution
What sort of printer are you using? A typical example for an HP Deskjet would be:

Step #1. Adding "of" line to printcap          

hp|hplj|HP_Deskjet1600c:        :lp=/dev/bpp0:\        
        :of=/usr/lib/deskjet.filter:\   ---->Add this line.
Step #2. Creating the filter.
# vi /usr/lib/deskjet.filter
Add the following info to the file.
Note. Make sure you include the single quotes where applicable and following
instructions below to insert the escape codes correctly or filter will not
The '&k2G' is to correct the staircase effect and 'E' is to eject the page.

#!/bin/csh -f
/usr/bin/echo -n '&k2G'
if      ($status == 0)  then
/usr/bin/echo -n 'E'
                exit 0
        exit 1

How to Insert Escape Code

Note. Select "i" for insert mode under VI.
Inserting <esc>&k2G

Press '
Press "ctrl" and "v" keys together. This will produce a ^
Press "esc" key this will produce [
Enter &k2G
Press '

Use same procedure for <esc>E

To check the escape code was inserted correctly execute;

cat -v /usr/lib/deskjet.filter    ---> Should appear as   '^[&k2G'


chmod 755 /usr/lib/deskjet.filter
hpmanAuthor Commented:
The printer is an OcĂ© 3165 which has an OS/2 PC as a controller.  This is why I need to do the conversion before it is sent to the remote system.  Currently, I have access to the Intel version of Solaris.  It's printers.conf file looks completely different than what you described.  The entries look like this:  3165:\ (next line down):\bsdaddr=3165,dac,Solaris:  If I put the if/of=/var/lib/3165.filter before the second line, the system tells me the printer is unknown.  If I put it after, I still get the staircase.  I'm working on getting access to a Sparc station to see if your solution works there.
Solaris doesn't use a printcap file, it being a SysV printing system. What printer type are you using on Solaris to print to the device? Does the printer do a Postscript or PCL emulation?
Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

hpmanAuthor Commented:
The printer is capable of both.
I copied the /etc/printers.conf file to the tmp directory and used conv_lpd to convert the copy from a printers.conf file to a printcap entry.  I added the of=... line and then used conv_lpd to convert it back and used the /tmp/printers.conf.  It made no difference.  I've also tried editing the /usr/lib/lp/model/standard and forcing the filter to equal the location of my script.  Any help would be greatly appreciated.
You could set the printer type neatly for a network printer with Solstice AdminSuite, but it can also be done via a command line. Since you say it can do both Postscript & PCL, we'll set it up as a Postscript printer as that's more compatible with Solaris. I'm assuming that you can send jobs to the remote printer via BSD LPR/LPD protocol.

The first thing to do is to see if the SysV printer filters have been set up with "lpfilter -l -f all". If there aren't any listed, the easiest way to get the system to set them up is to add (and then remove) a dummy postscript printer with admintool. Just tell it that the printer is local on any port, it doesn't matter which.

Verify that "lpfilter -l -f all" now shows filter types, and then you can set up a network printer. In the example below I've used "prt" for the queue on the node "printer.on.net". You'll need to change the remote queue name and nodename to suit. Create the queue for a remote networked printer with:

root> lpadmin -p prt -T PS -I PS -F continue -o nobanner \
> -h -v /dev/null -m netstandard -o dest=printer.on.net \
> -o protocol=bsd -D "PS Printer"

I normally disable banner page printing by editing the interface file (/etc/lp/interfaces/prt in this example) and change "nobanner=no" to "nobanner=yes".

Then enable printing with:

root> enable prt
root> accept prt

You can look at the man pages for the commands I've used for more info.
hpmanAuthor Commented:
Adjusted points from 20 to 100
hpmanAuthor Commented:
I'm thoroughly confused!  Your suggestion did not work.  I've tried just about every option for lpadmin.  The last attempt that has me so confused is what interface script is actually being run?  I used the following commands to create a basic remote printer
lpadmin -p test -s dac ! test -v/dev/null (or use admintool to create a remote printer)
I can print to the printer.  I next create an executable called test which does nothing more than cat "hello" to a tmp file.  I used the -i and -m options for lpadmin to point to this.  Nothing appears in the tmp directory and the job prints.  With HP, rmodel is used for remote printers.  I modified that script for this printer and it works fine.  I've tried modifying both the standard and netstandard files, but from the above test, they don't seem to run for a remote printer.  Any idea's would greatly be apprciated.
It may not have worked when you used my example as the "remote printer" might not implement the BSD LPR/LPD printing service (or perhaps not in an RFC compliant manner). Is it a "raw network" service or is it supposed support the LPR/LPD protocols?
hpmanAuthor Commented:
It's supposed to support LPR/LPD.  
We have opened up a new Solaris Topic Area.  

To increase the visibility of questions, we moved questions we felt
appropriate to the new Solaris Topic Area where they will be easier for
Solaris experts to find and answer. You may view your question at

If you have any questions about the new topic area you can contact
Community Support by posting a comment at the following URL or by
emailing us at cs@experts-exchange.com.

Community Support @ Experts Exchange

I have 2.6 and 2.7 boxes here where I work. In our printer.conf file,
this is how we have them setup.

#       If you hand edit this file, comments and structure may change.
#       The preferred method of modifying this file is through the use of
#       lpset(1M) or fncreate_printer(1M)

When I added the printer through the admintool, I also was getting the
staircase effect. Once I looked at one of our other boxes here with these settings, and changed them appropriately, that effect went away.

In the example above, "nocprint" is the printername, foulmouth is the hostname to DNS resolves for nocprint's IP.

All I can say is, the above setting worked for me. I think that "text" and "Solaris" were missing from the entry when I tried to add the printer with the admintool.
Whoa, I think I had points taken away from me on this one. Wasn't this answer accepted middle of last week?
hpmanAuthor Commented:
You should have gotten the points.
Initially, I did, but it looks like they were taken away. I wonder if it had anything to do with Experts Exchange server crashing. Another guy on here I know said that the server crashed. He lost points, and comments. I seem to have lost comments from other questions as well.
hpmanAuthor Commented:
This was the e-mail that I received this morning.  I don't know who you would contact.

Dear Experts Exchange Members,
As many of you noticed yesterday, our site was having significant technical
problems. Late Friday night, our third-party hosting facility suffered a
severe crash and our site went down as a result.  We've worked non-stop to
recover and rebuild our site and database hosted on their servers. As we
send out this e-mail, the site is back up and we'll be monitoring it around
the clock to ensure its stability.
We sincerely thank all of you for your patience. We're taking steps to make
sure that this will never happen again.
Needless to say, it's an exciting time to be a part of the Experts Exchange
community. We value your contribution to the site, and are planning several
new enhancements in the near future that will make Experts Exchange even
Thank you again for your patience,
The staff at Experts Exchange
Comment accepted as answer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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