Monday, October 23, 2006

Problematic Printing

I've just migrated an important service off an old Solaris 8 machine onto a new(ish) server running Solaris 10.

Everything went pretty smoothly, with the exception of a few little printing problems. (I'm not a printer person, really. Whatever happened to the paperless office?)

I had just used lpadmin to set up the printers. I've read that printing in Solaris 10 is much better than it used to be (and that may be true) so that it can drive printers properly out of the box without the need for extra products like the HP JetDirect (what used to be JetAdmin) printer driver. Indeed, to the point that you're not supposed to use JetDirect any more.

In our testing we had ended up setting the type to any (rather than postscript) and using the netstandard model script. Anything more sophisticated and it mangled some of the printouts (specifically, we had some plaintext reports that had embedded characters to switch the printer to landscape that didn't work).

What we discovered today was that printer tray and media selection weren't working. I had been told that this was done in the application, but what that actually meant was that there was a wrapper shell script that called lp with some options that the jetdirect software can understand. And clearly the vanilla print system under Solaris doesn't grok those options.

So what I've had to do is to install the latest version of the JetDirect software that I can find (E10.34). And then add the specific model scripts for our model printers (and these are on the HP website, although they're a devil to find and the HP search is almost useless). And then using that to drive the printers made everything work flawlessly.

I'm sure there must be a way to pass the appropriate printer options to select the correct media type without running everything through JetDirect, but I've yet to find it. (Oh, and it would be nice if it used the same option names, to save having to track down every wrapper script that might be involved, although that's not absolutely necessary.)

3 comments:

paulcun said...

It's easier to set up your printers on Solaris 10 (and later updates of Solaris 9) using the 'Solaris Print Manager' GUI, /usr/sbin/printmgr (on s10).

The print queues are then setup using foomatics and PPDs, this allows printer options to be passed to the physical print via the PAPI interface (see http://opensolaris.org/os/community/printing/).

Printer options can then be sent to the printer using the 'lp' command '-o' option, eg. for A4 paper ...

lp -d myprinter -o media=a4 myfile

The options that can be used are those defined by IPP (Internet Print protocal) in "RFC2911 IPP Model and Semantics, Section 4.2" (http://www.ietf.org/rfc/rfc2911.txt). These will only work of cause if the printer and the ppd file support them.

Some of these options are:

media=
copies=
finishings=
sides=
number-up=
orientation-requested=
etc.

Extract: The values for "media" include medium-names, medium-sizes, input-trays and electronic forms so that one attribute specifies the media.

Hope that helps

Peter Tribble said...

The snag is that I had set things up the new way to start with - using lpadmin is pretty easy (and can be automated).

The problem was that using foomatic meant that much of the output was mangled - in particular, none of the plain text came out the way it was supposed to.

When I got rid of foomatic and passsed everything through raw, then it came out correctly, but not always from the correct tray. So the builtin printing support fails to work correctly.

Using JetDirect everything comes out correctly and on the correct media. So that's what we have to go with (it's a business critical system).

Johannes said...

The print manager has an option to show you the commands it used to create the needed stuff.

It showed me something like:
/usr/sbin/lpadmin -p $PRINTER -v /dev/null -T PS -A write -i /usr/lib/lp/model/netstandard -o dest=$PRINTER -o protocol=bsd -o nobanner -I postscript -u allow:all
/usr/sbin/lpadmin -p $PRINTER -D "$PRINTER drucker"
/usr/bin/enable $PRINTER
/usr/sbin/accept $PRINTER
/usr/sbin/lpfilter -f catv -F /etc/lp/fd/catv.fd
/usr/sbin/lpfilter -f download -F /etc/lp/fd/download.fd
/usr/sbin/lpfilter -f dpost -F /etc/lp/fd/dpost.fd
/usr/sbin/lpfilter -f postdaisy -F /etc/lp/fd/postdaisy.fd
/usr/sbin/lpfilter -f postdmd -F /etc/lp/fd/postdmd.fd
/usr/sbin/lpfilter -f postio -F /etc/lp/fd/postio.fd
/usr/sbin/lpfilter -f postior -F /etc/lp/fd/postior.fd
/usr/sbin/lpfilter -f postmd -F /etc/lp/fd/postmd.fd
/usr/sbin/lpfilter -f postpages -F /etc/lp/fd/postpages.fd
/usr/sbin/lpfilter -f postplot -F /etc/lp/fd/postplot.fd
/usr/sbin/lpfilter -f postprint -F /etc/lp/fd/postprint.fd
/usr/sbin/lpfilter -f postreverse -F /etc/lp/fd/postreverse.fd
/usr/sbin/lpfilter -f posttek -F /etc/lp/fd/posttek.fd
/usr/sbin/lpfilter -f pr -F /etc/lp/fd/pr.fd

I hope you or someone reading this could use the information.

Btw: you have a really informative site. Congratulations & thx.