![]() ![]()
Use of JCP site is subject to the
JCP Terms of Use and the
Oracle Privacy Policy
![]() ![]() ![]() ![]() |
![]() |
The JavaTM Print Service API (JPS API).
BackgroundThis API was begun as part of the efforts of the JINITM printing working group (JPWG) including Xerox Corp. The JPWG wished to ensure that printing though the JINI printing API would unify as well as possible with existing Java print APIs as they developed. Consequently the JSR 006 Unified Printing API was proposed to unify Java programming language printing APIs which may otherwise unnecessarily diverge. Specific goals of the API are
The package may be delivered in two ways:
ApproachThe draft API specification is very largely derived from work performed by the JINI Printing Working Group (JPWG) which asked the JSR006 expert group to take elements of the API they had developed and promote it to become a standard part of the Java 2 platform through the Java Community Process. As such these APIs have already benefited from almost a year of development and review by elements of the JINI community, notably including many of the most prominent printer vendors, (including, but not limited to, Xerox, Lexmark, Canon, Epson, Kodak, HP). The JINI community work can be viewed by becoming a member of the JINI community at http://www.jini.org. In essence the classes in the JINI API which have broad applicability to printing applications, have been identified. Where possible the classes and interfaces have been unchanged from the JINI ones. In other cases non-JINI specific versions have been created which largely mirror the JINI-specific classes. This draft specification will be updated to reflect both JCP feedback and final API refinements in the JINI Printing API 1.0 draft. The key elements of the Java Print Service API are: Target users of the APIAny applications which want to be able to print through Java printing APIs. This API will allow client applications to provide rich access to the capablities of print services available such as printer browsing and selection, and discovery of the capablities of those printers, selection of printers for a printer job, specification of a printer job such as paper sizes, etc. Availability of specific capabalities is necessarily dependent on the underlying print service. Since all capabilities will be exposed though API server applications become first class citizens of this API.
Server applications may be beneficiaries of the capabilities for
spooling documents to print services, whereas previously only graphics
calls could be used to generate printer jobs from Java applications.
The abstract class PrintServiceLookup may be implemented by any party
which installs it using the
SPI JAR file specification.
This class provides a standardised API for looking up instances of print
services. For example an IPP print service provider, a JINI lookup
service, or a JNDI-based directory service may each be implementations of
this class which can return PrintServices.
An API is provided to locate print services which can print a particular
type of document in combination with a specified set of job attributes
(see below).
The definition of the attributes defined by the IPP constitutes the majority
of the JPS API.
These cover concepts such as resolution, copies, media sizes, job priority,
and page ranges.
A DocFlavor class which encapsulates a MIME type and a document representation
class is used to provide type information for a printable document ("Doc").
A Doc maybe a Postscript file, a JPEG image. a URL or plain text.
These are just examples. To print the document call the print() method
on a DocPrintJob obtained from a suitable PrintService.
A typical use of the API may be to find printers which can support
printing 5 copies of a Postscript document, double-sided on A4 paper.
stapled.
This involves locating a PrintService which supports all of these
requirements, creating a print job, and calling print.
This example API usage could look like :-
What is exposed at the javax.print API layer is limited to what has
been identified as common across printing services.
For example this means that in the case of JINI if a particular application
needs to set its own policies for dealing with a spontaneous service
location and recovery from transient network problems, it probably ought
to be a JINI printing client using that API directly rather than the JPS
API.
The Java 2DTM printing API (java.awt.print package) will be unified
with the javax.print API to allow clients of that API access to printer
capabilities and print job specification.
Unifying that API with the Java Print Service API is part of the JSR006
expert group aims, but the specific API to to that is solely part of
the core Java 2 platform, and the API to accomplish that is not in the
JPS API, but will be included for review in the J2SE releases
The Java(TM) Print API specification is Copyright � 2000 Sun Microsystems, Inc.
Java is a trademark of Sun Microsystems, Inc.
|