Printing

The ability to print graphics to a printing device was introduced in Java 1.1. However, it's only through Java 2D that printing has become sophisticated. You can use Java 2D's printing API to perform the following tasks:

  • Print Java 2D and AWT graphics (including text and images)

  • Control document composition (such as reverse order printing)

  • Invoke printer-specific functions (such as stapling)

Note

Not all the aforementioned tasks are completely implemented in Version 1.3 of Java 2.

The printing API is located in the java.awt.print package. This package contains three interfaces and four classes, which are described in Table 18.3.

Table 18.3. Printing Classes and Interfaces
Interface/Class Description
Book This class provides ...

Get Special Edition Using Java 2 Standard Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.