
The JPS (Java Print Service), on which the JPDF is based, provides a large number of
Standard Print Attributes
to control printing. These include attributes that specify the paper size, page orientation, page margins, and so on.
A Print Attribute Set is used when a Print Job is submitted to the JPS for execution. The JPS uses this Attribute
Set to print according to the
Standard Print Attribute values within it.
NOTE: |
The JPDF makes use of and extends the capabilities of the JPS (Java Print Service). The JPS
is part of the Standard Edition JRE (Java Runtime Environment) beginning with JRE
version 1.4. JPS classes are contained in packages which begin with javax.print .
|
The JPDF provides many Custom Print Attributes which allow you to specify additional printing options. These are
used by the JPDF Printers (JPDF classes which render application data for printing purposes). The JPDF Custom
Print Attributes are stored in the same Print Attribute Set as the Standard Print Attributes, and are used by
the Printer during the printing process. The JPS and Printers ignore any attributes in the set that they
do not recognize or which are not relevant in the current context.
Your application may use a single Print Attribute Set, or multiple Print Attribute Sets – one of each type of data
element that can be printed. The attribute set would typically contain a mixture of Standard and Custom print attributes.
These can be placed in the attribute set programmatically or by the end-user using a Page Setup or Print dialog.
A common usage scenario is to programmatically establish an initial Print Attribute Set for your application, and then
provide Page Setup and Print dialogs which allow the user to modify some or all of the attributes in this set. When the
user exits your application you can employ some persistence mechanism to save the current Attribute Set contents so that
it can be restored the next time the user enters your application. (Class serialization may be used for attribute set
persistence, as attribute sets are serializeable.)
The following tables list the Custom Print Attributes provided by the JPDF (individual JPDF Printers support a
subset of these). The General, Aligning/Positioning/Scaling, and Page Headers/Footers tables contain
attributes which can pertain to any type of printed material. The subsequent tables contain attributes that pertain
to printing various types of Swing components.
Specifies the background color for the material to be printed. |
Specifies the font used for the text to be printed. |
Determines whether a frame is printed surrounding the printed content. |
Specifies the foreground color for the material to be printed. |
Specifies whether the Logical Page edges are to be printed when printing
multiple Logical Pages on each Physical Page. (This is used in conjunction with the
NumberUp Standard Attribute.)
|
Determines whether a frame is printed just inside the margins of each page. |
Specifies whether only odd numbered or only even numbered pages are to be printed. |
Specifies the horizontal alignment of the content to be printed. Can be any value between
zero and one (0.0 for left aligned, 0.5 for center aligned, and 1.0 for right aligned). |
Specifies the vertical alignment of the content to be printed. Can be any value between
zero and one (0.0 for top aligned, 0.5 for center aligned, and 1.0 for bottom aligned). |
Specifies the number of pages (horizontally and vertically) to be used. The material to be printed
is scaled to fit the specified pages. |
Determines whether the printed material is scaled to fit the pages
specified by the FitToPages attribute. |
Specifies an offset from the bottom margin for positioning of the content to be printed. |
Specifies an offset from the left margin for positioning of the content to be printed. |
Specifies an offset from the right margin for positioning of the content to be printed. |
Specifies an offset from the top margin for positioning of the content to be printed. |
Specifies the scale (magnification) factor for the printed material. |
Specifies the maximum scale (magnification) factor to be allowed. |
Specifies the minimum scale (magnification) factor to be allowed. |
Specifies the content of the Page Footer using a Text Document. |
Determines whether a line separating the Page Footer from the page content is printed. |
Determines whether Page Footers are printed on the first page. |
Provides two indepedent Page Footers: one which specifies the content of the Footer on the first page,
and another which specifies the content of the Footer on the remaining pages.
|
Specifies the content of the Page Footer using HTML. |
Specifies the content of the Page Footer using three strings (left, center, right). |
Specifies the content of the Page Header using a Text Document. |
Determines whether a line separating the Page Header from the page content is printed. |
Determines whether Page Headers are printed on the first page. |
Provides two indepedent Page Headers: one which specifies the content of the Header on the first page,
and another which specifies the content of the Header on the remaining pages.
|
Specifies the content of the Page Header using HTML. |
Specifies the content of the Page Header using three strings (left, center, right). |
Determines whether the Component's background color is printed on the entire imageable region
of the page (as opposed to just the part of the page in which the Component is printed). |
Determines whether the Component's background color is printed. |
Determines whether the selected section of text is highlighted when printed. |
Determines whether the text is wrapped to fit the available page width. |
Determines whether the table headers are repeated on every page. |
Determines whether the selected table cells are highlighted when printed. |
Determines whether table horizontal grid lines are printed. |
Determines whether table vertical grid lines are printed. |
Determines whether table columns are bisected at the right page margin. |
Determines whether the selected tree branches are highlighted when printed. |
Specifies how the tree is expanded for printing purposes. |