[Chapter 19] PrintJob

#

| Chapter 19 java.awt Reference |

# PrintJob

## Name

PrintJob

##

## Description

`PrintJob` encapsulates printing information. When you call `Toolkit.getPrintJob()`, this is the object that is returned. From the `PrintJob`, you can access a `Graphics` object, which can be used for drawing to the printer.

## Class Definition

    public abstract class jav.awt.PrintJob
        extends java.lang.Object {
      // Instance Methods
      public abstract void end();
      public void finalize();
      public abstract Graphics getGraphics();
      public abstract Dimension getPageDimension();
      public abstract int getPageResolution();
      public abstract boolean lastPageFirst();
    }

## Instance Methods

### end

#### public abstract void end()

Description

  Ends printing and cleans up.

### finalize

#### public void finalize()

Overrides

  `Object.finalize()`

Description

  Cleans up when this object is garbage collected.

### getGraphics

#### public abstract Graphics getGraphics()

Returns

  A `Graphics` object representing the next page. The object returned will also implement the `PrintGraphics` interface.

Description

  Returns a `Graphics` object for printing.

### getPageDimension

#### public abstract Dimension getPageDimension()

Returns

  The page dimensions in pixels.

### getPageResolution

#### public abstract int getPageResolution

Returns

  The page resolution, in pixels per inch.

### lastPageFirst

#### public abstract boolean lastPageFirst()

Returns

  `true` if pages are printed in reverse order; `false` otherwise.

## See Also

`Dimension`, `Graphics`, `PrintGraphics`, `Toolkit`

PrintGraphics |  | Rectangle