Java Platform 1.2
Beta 4

Interface java.awt.print.Printable


public abstract interface Printable
A Printable object is called by PrinterJob to render the graphics of a page.

See Also:
PrinterJob

Field Summary
static int NO_SUCH_PAGE
          Returned from print() to signify that the pageIndex was too large and that the requested page does not exist.
static int PAGE_EXISTS
          Returned from print() to signify that the requested page was rendered.
 
Method Summary
 int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
          A PrinterJob will call the Printable interface requesting that a page be rendered into 'graphics'.
 

Field Detail

PAGE_EXISTS

public static final int PAGE_EXISTS
Returned from print() to signify that the requested page was rendered.

NO_SUCH_PAGE

public static final int NO_SUCH_PAGE
Returned from print() to signify that the pageIndex was too large and that the requested page does not exist.
Method Detail

print

public int print(Graphics graphics,
                 PageFormat pageFormat,
                 int pageIndex)
          throws PrinterException
A PrinterJob will call the Printable interface requesting that a page be rendered into 'graphics'. The format of the page to be drawn is supplied in 'pageFormat' while the zero based index of the requested page is passed in 'pageIndex'. If the requested page does not exists then this method should return 'NO_SUCH_PAGE', otherwise PAGE_WAS_DRAWN is to be returned. The Graphics class or subclass will implement the PrinterGraphics interface to provide additional information. If the Printable object wants to abort the print job then it should throw a PrintException.
Parameters:
java.awt.Graphics - The page is drawn into this object.
java.awt.print.PageFormat - The size and orientation of the page being drawn.
int - The zero based index of the page to be drawn.
Returns:
PAGE_WAS_DRAWN if the page is rendered successfully or NO_SUCH_PAGE if 'pageIndex' specifies a non-existent page.
Throws:
PrinterException - printing should be stopped.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.