public final class PrintPreferences
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
PrintPreferences.Alignment |
Constants for center, right, left position of page header, footer.
|
| Modifier and Type | Method | Description |
|---|---|---|
static PrintPreferences.Alignment |
getFooterAlignment() |
|
static java.awt.Font |
getFooterFont() |
|
static java.lang.String |
getFooterFormat() |
|
static PrintPreferences.Alignment |
getHeaderAlignment() |
|
static java.awt.Font |
getHeaderFont() |
|
static java.lang.String |
getHeaderFormat() |
|
static float |
getLineAscentCorrection() |
|
static java.awt.print.PageFormat |
getPageFormat(java.awt.print.PrinterJob pj) |
Get an instance of
PageFormat. |
static boolean |
getWrap() |
Wrap lines.
|
static void |
setFooterAlignment(PrintPreferences.Alignment alignment) |
|
static void |
setFooterFont(java.awt.Font f) |
|
static void |
setFooterFormat(java.lang.String s) |
Set the text for the page footer.
|
static void |
setHeaderAlignment(PrintPreferences.Alignment alignment) |
|
static void |
setHeaderFont(java.awt.Font f) |
|
static void |
setHeaderFormat(java.lang.String s) |
Set the text for the page header.
|
static void |
setLineAscentCorrection(float correction) |
|
static void |
setPageFormat(java.awt.print.PageFormat pf) |
|
static void |
setWrap(boolean wrap) |
public static java.awt.print.PageFormat getPageFormat(java.awt.print.PrinterJob pj)
PageFormat.pj - PrinterJob which is
associated with the default printer.PageFormat that describes the size and
orientation of a page to be printed.public static void setPageFormat(java.awt.print.PageFormat pf)
pf - PageFormat that describes the size and
orientation of a page to be printedpublic static boolean getWrap()
public static void setWrap(boolean wrap)
wrap - See getWrap()public static java.lang.String getHeaderFormat()
public static void setHeaderFormat(java.lang.String s)
s - the text for the page headerpublic static java.lang.String getFooterFormat()
public static void setFooterFormat(java.lang.String s)
s - the text for the page footerpublic static java.awt.Font getHeaderFont()
public static void setHeaderFont(java.awt.Font f)
f - the font for the headerpublic static java.awt.Font getFooterFont()
public static void setFooterFont(java.awt.Font f)
f - the font for the footerpublic static PrintPreferences.Alignment getHeaderAlignment()
public static void setHeaderAlignment(PrintPreferences.Alignment alignment)
alignment - whether the header should be centered, left aligned, or right aligned.public static PrintPreferences.Alignment getFooterAlignment()
public static void setFooterAlignment(PrintPreferences.Alignment alignment)
alignment - whether the footer should be centered, left aligned, or right aligned.public static float getLineAscentCorrection()
public static void setLineAscentCorrection(float correction)
code - correction the amount of vertical space to print between lines.java.lang.IllegalArgumentException - if correction is less than 0.Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.