The following table lists various print methods and, for each, describes how headers and footers work when you use that method.
Method |
Responsibility for Page Margins |
---|---|
|
The |
|
You set headers and footers, as described in this topic. The view printer prints the headers
and footers, starting at 18 pixels (by default) from the top and bottom of the page. You can
change the header and footer margins using the |
|
You set header and footer properties, as described in this topic. The view printer prints the
headers and footers, starting at 18 pixels (by default) from the top and bottom of the
|
|
You are completely responsible for headers and footers. None of the properties that this topic describes has any effect. |
Each view printer has six HeaderAndFooterPainter
objects, so you can display
three headers and three footers on printed pages. To specify information for a header or footer,
you get the appropriate HeaderAndFooterPainter
and set its properties.
The constant that you pass in ViewPrinter.getHeaderAndFooterPainter
determines which header or footer you get. The constants identify the location
of the header or footer, as shown in the following table, which lists the constants
and their descriptions.
Constant for |
Description |
---|---|
|
The left header. Left-aligned by default. |
|
The center header. Centered by default. |
|
The right header. Right-aligned by default. |
|
The left footer. Left-aligned by default. |
|
The center footer. Centered by default. |
|
The right footer. Right-aligned by default. |
The content of the headers is specified by the ContentType
property
of the HeaderAndFooterPainter
. The following table lists the valid
constants for the ContentType
property and their descriptions.
Constant for |
Description |
---|---|
|
No content |
|
The current date |
|
The page number |
|
One or more strings, each on its own line |
The following examples show how to specify headers and footers: