So far, you have seen how to print 2D graphics. However, the printing API introduced in Java SE 1.4 affords far greater flexibility. The API defines a number of data types and lets you find print services that are able to print them. Among the data types are
• Images in GIF, JPEG, or PNG format
• Documents in text, HTML, PostScript, or PDF format
• Raw printer code data
• Objects of a class that implements
The data themselves can be stored in a source of bytes or characters such as an input stream, a URL, or an array. A document flavor describes the combination of a data source and a data type. The
DocFlavor class defines a number of inner classes for the various data sources. Each ...