Module java.desktop
Package java.awt

Class PageAttributes

java.lang.Object
java.awt.PageAttributes
All Implemented Interfaces:
Cloneable

public final class PageAttributes extends Object implements Cloneable
A set of attributes which control the output of a printed page.

Instances of this class control the color state, paper size (media type), orientation, logical origin, print quality, and resolution of every page which uses the instance. Attribute names are compliant with the Internet Printing Protocol (IPP) 1.1 where possible. Attribute values are partially compliant where possible.

To use a method which takes an inner class type, pass a reference to one of the constant fields of the inner class. Client code cannot create new instances of the inner class types because none of those classes has a public constructor. For example, to set the color state to monochrome, use the following code:

 import java.awt.PageAttributes;

 public class MonochromeExample {
     public void setMonochrome(PageAttributes pageAttributes) {
         pageAttributes.setColor(PageAttributes.ColorType.MONOCHROME);
     }
 }
 

Every IPP attribute which supports an attributeName-default value has a corresponding setattributeNameToDefault method. Default value fields are not provided.

Since:
1.3