An implementation of the PrintService interface represents an actual printer that might be returned from an implementation of PrintServiceLookup. The PrintService can be queried to determine its capabilities by invoking one of the many methods that return the print service's supported attributes. The Locating Services section of the Printing and Streaming Documents chapter discusses using PrintService and PrintServiceLookup.
The JDK includes PrintServiceLookup implementations that can locate the standard platform printers. To locate other types of printers, such as IPP printers or JINI printers, a print-service provider can write implementations of PrintServiceLookup. The print-service provider can dynamically install these PrintServiceLookup implementations using the SPI JAR file specification.
Rather than sending data to a printer, an application can also print the data to an output stream using a StreamPrintService, which allows the application to convert the data to different formats. To obtain a StreamPrintService, an application uses the lookup methods of the StreamPrintServiceFactory abstract class. This class is similar to that of the PrintServiceLookup class in that it also discovers print services. The chapter Printing and Streaming Documents describes using StreamPrintServiceFactory and StreamPrintService. A StreamPrintService can also be used to send 2D graphics to an output stream. See Printing and Streaming 2D Graphics for more details.
The javax.print.attribute and javax.print.attribute.standard packages define print attributes, which describe a capability of a print service, a charactaristic of a document, an instruction for processing a document or an entire print job, or the state of a print job or printer.
The javax.print.attribute package describes the types of attributes and how they can be collected into sets. The Attribute interface is the superinterface for all attributes. The javax.print.attribute package includes classes and interfaces defining the five different kinds of attributes, each of which describes the capabilities of one piece of the printing process. For example, the PrintRequestAttribute interface defines attributes that clients use to describe the characteristics of a print job, which might include the number of copies to print.
The javax.print.attribute.standard package enumerates all of the standard attributes supported by the API, most of which are implementations of attributes specified in the IPP specification. The Attributes chapter discusses the attribute API in more detail.