System News
Printing Solution Resources for the Solaris Operating Environment
Integrating Print Functionality, Basic Principles and More
October 14, 2002,
Volume 56, Issue 3

Software engineer Eric Reid provides tips for integrating printing into SolarisTM Operating Environment (Solaris OE) applications. While there are no application programming interfaces (APIs) specifically for printing in Solaris OE, there are three printing-related call-level interfaces (CLIs). Understanding the functions of these CLIs, along with some basic rules, will help developers quickly integrate printing functionality such as querying for available printers and submitting jobs for output.

To implement printing, developers need to become familiar with the three call-level interfaces: lpstat(1), lp(1) and cancel(1). Their complete definition can be found in the System V Interface Definition (SVID) or in the Solaris OE online man pages.

Did You Know:

  • To generate a list of available printers programmatically, use the public interface to lpstat(1) to obtain a listing of all printer status. You can then parse the output for the name of the printers. The public interface to lpstat(2) would be executed using popen(3S).

  • To submit a job programmatically, use the public interface to lp(1).

  • To integrate support for new printers, first read the Solaris OE Administrator's Guide.

Do not assume that because the client side of Solaris OE printing behaves like a BSD-style system, the server side will also. Actually, Solaris OE 2.6 does not contain a BSD-style print system. Instead, it contains a UNIXR system V-style lp server with software to take requests through the lpd protocol. The server is very much like System V internally and in much of its external interfaces.

A print utility application wishing to have greater control over lp may be inclined to rename /usr/bin/lp and have some lp_wrapper script call it under certain conditions. This is very dangerous and is discouraged by Sun. For more from Reid, see:

http://soldc.sun.com/articles/printfunct.html

Alice Soteriou has written about basic principles of printing in the Solaris OE 2.6 and above. Solaris 2.6 delivered a re-engineered print subsystem that improved and changed the product. These changes have resulted in much confusion as to what is supported and what is not. There's also uncertainty in figuring out the best way to create and maintain a reliable print server. Customers use a variety of methods to maintain their print servers, with which they may be very satisfied. However, if these methods are not supported by Sun, it can be very difficult to diagnose and fix issues.

Soteriou provides a simple guide on how to create and administer print servers and clients. The troubleshooting section will help you locate exactly where your printing problem occurs and how to go about fixing it. Soteriou offers basic definitions for clarity.

Definitions in the list include print server or spooler, print client and local and remote printing. Soteriou discusses common myths such as port monitors being required to print. She also covers creating and managing a print server, using third party software to create queues, configuring print clients and more. For additional details, see:

http://soldc.sun.com/articles/basicprinting.html

For additional printing tips, see:

http://soldc.sun.com/articles/print/sol_lp2.html [...read more...]

Keywords:

fullsource
 

Other articles in the Developer section of Volume 56, Issue 3:

See all archived articles in the Developer section.



News and Solutions for Users of Solaris, Java and Oracle's Sun hardware products
Just the news you need, none of what you don't – 42,000+ Members – 24,000+ Articles Published since 1998