BigAdmin System Administration Portal
Community-Submitted Tech Tip
Print-friendly VersionPrint-friendly Version
This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article. Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
 
 

Duplex Printing on the Solaris 10 OS

Garrett D'Amore, November 2005


Introduction

I recently upgraded my system to the Solaris 10 OS and was faced with trying to get my printer configured so that I could print two-sided output to it.

The printer I'm using is a Brother HL-5170DN, and it works great with the Solaris OS, as it supports PostScript emulation natively, is networked, and even has support for two-sided output. All these features are provided at a price point that makes the device competitive with other personal laser printers.

The Solaris 10 OS has nice support for setting this up, but it is, unfortunately, not documented anywhere that I could find. (Fortunately for me, the filters involved were all in readable shell script form, so I could figure this out and pass it on to you.)


Initial Setup

First, you have to configure the print queue to use a PostScript Printer Description (PPD), by means of the Solaris OS lpadmin command. The Solaris 10 OS ships with PPDs for a bunch of printers, which are located in subdirectories organized as /usr/lib/lp/model/ppd. However, your printer, like mine, may not be listed. Generally you can get PPDs for the printer from the manufacturer.

If the printer does not support PostScript, it will probably not have a PPD from the manufacturer. Then the problem becomes a bit harder, particularly if a PPD for the printer, or a model very close to your printer, is not available. For the moment I'll assume that you have a PPD that works with your printer, either from the Solaris OS installation or from the printer manufacturer.

You will use the lpadmin utility to set up the print queue. Here is an example for my printer, which is on the network as the host name laser:

# lpadmin -p myprinter \
  -v /dev/null -m netstandard_foomatic  -o protocol=bsd,dest=laser \
  -T PS -I postscript \
  -n /usr/local/ppds/br_5170_2.ppd

In the above, -T PS and -I postscript indicate that this is a PostScript-capable printer; you need this to prevent the printing subsystem from trying to send ASCII banner pages to it.

The -n option indicates the location of my PPD file. Obviously, you will use the real location of your file, which might be a file in /usr/lib/lp/model/ppd, or it may be somewhere else on the system.

The -m, -v, and -o options basically configure access to the printer itself. If your printer is locally attached you might have something like this instead:

# lpadmin -p myprinter \
    -T PS -I postcript \
    -v /dev/ecpp0 -m standard_foomatic \
    -n /usr/local/ppds/br_5170_2.ppd

You also need to configure lpsched, to enable the queue and printer, with these commands:

# accept myprinter
# enable myprinter

Testing

Having done this, you have a printer that is using the PPD, and you can now print duplex pages using the following command syntax:

% lp -d myprinter -o sides=two-sided-long-edge somefile.ps

You can use short-edge binding as well:

% lp -d myprinter -o sides=two-sided-short-edge somefile.ps

Finally, you can force single-sided printing:

% lp -d myprinter -o sides=one-sided somefile.ps

Setting Default Queue Options

OK, all that is nice, but having to specify those options is pretty annoying if you do this very often. A much simpler solution is to set the default for this queue, using the lpadmin command:

% lp -p myprinter -o sides=two-sided-long-edge

Voila! Now you can print just using normal lp commands and it will default to two-sided printing.

If your printer is networked, you can use this technique to set up different queues with different default options, which I find quite useful:

# lpadmin -p laser \
  -v /dev/null -m netstandard_foomatic  -o protocol=bsd,dest=laser \
  -T PS -I postscript \
  -n /usr/local/ppds/br_5170_2.ppd

# lpadmin -p lduplex \
  -v /dev/null -m netstandard_foomatic  -o protocol=bsd,dest=laser \
  -T PS -I postscript \
  -n /usr/local/ppds/br_5170_2.ppd \
  -o sides=two-sided-long-edge

# lpadmin -p sduplex \
  -v /dev/null -m netstandard_foomatic  -o protocol=bsd,dest=laser \
  -T PS -I postscript \
  -n /usr/local/ppds/br_5170_2.ppd \
  -o sides=two-sided-short-edge

All of the other ordinary printer administration commands work with these queues, too. For example, I have disabled banner pages with this command:

# lpadmin -p myprinter -o banner=never

Other Options

The foomatic filters also have support for other options, which I have not fully explored yet. For example, this foomatic-rip option can select the type, size, and location of print media:

    -o media=x,y,z

This option can specify the paper size, tray, and type of paper.

    -o media=Letter
    -o media=Letter,MultiPurpose
    -o media=Letter,Transparency
    -o media=Letter,MultiPurpose,Transparency

Paper sizes can be one of the following:

    Letter, Legal, A4, COM10, DL

Trays are defined by the PPD, but examples might be:

    Upper, Lower, MultiPurpose, LargeCapacity

About the Author

Garrett D'Amore works for Tadpole Computer where he writes device drivers for the Solaris OS and Sun Ray thin clients. He is also the author of a number of freely available software packages, which can be found on his web site: http://garrett.damore.org/.

 


The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource.

Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.


BigAdmin