站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.4.1, Java 2 SDK 英文文档

Java Print Service API User Guide: 5 - Printing and Streaming 2D Graphics - JDK 5 Documentation v1.4.1, Java 2 SDK 英文文档

CONTENTS | PREV | NEXT JavaTM Print Service API User Guide



CHAPTER 5

Printing and Streaming 2D Graphics




The Java 2DTM printing API is the java.awt.print package that is part of the JavaTM 2 SE, version 1.2 and later. The Java 2D printing API provides for creating a PrinterJob, displaying a printer dialog to the user, and printing paginated graphics using the same java.awt.Graphics and java.awt.Graphics2D classes that are used to draw to the screen.

Many of the features that are new in the Java Print Service, such as printer discovery and specification of printing attributes, are also very important to users of the Java 2D printing API. To make these features available to users of Java 2D printing, the java.awt.print package has been updated for version 1.4 of the JavaTM 2 SE to allow access to the JavaTM Print Service from the Java 2D printing API.

Developers of Java 2D printing applications have four ways of using the Java Print Service with the Java 2D API:

  • Print 2D graphics using PrinterJob.
  • Stream 2D graphics using PrinterJob
  • Print 2D graphics using using DocPrintJob and a service-formatted DocFlavor
  • Stream 2D graphics using DocPrintJob and a service-formatted DocFlavor
The Using PrinterJob to Print or Stream Graphics section explains the first two methods. The Using Service-Formatted Data section explains the other two methods.



CONTENTS | PREV | NEXT
Copyright © 2001 Sun Microsystems, Inc. All Rights Reserved.