public class StyledTextPrintOptions
extends java.lang.Object
The following example prints a right aligned page number in the footer, sets the job name to "Example" and prints line background colors but no other formatting:
StyledTextPrintOptions options = new StyledTextPrintOptions(); options.footer = "\t\t<page>"; options.jobName = "Example"; options.printLineBackground = true; Runnable runnable = styledText.print(new Printer(), options); runnable.run();
Modifier and Type | Field and Description |
---|---|
java.lang.String |
footer
Formatted text to print in the footer of each page.
|
java.lang.String |
header
Formatted text to print in the header of each page.
|
java.lang.String |
jobName
Name of the print job.
|
java.lang.String[] |
lineLabels
Labels used for printing line numbers.
|
static java.lang.String |
PAGE_TAG
Page number placeholder constant for use in
header
and footer . |
boolean |
printLineBackground
Print the line background color.
|
boolean |
printLineNumbers
Print line numbers.
|
boolean |
printTextBackground
Print the text background color.
|
boolean |
printTextFontStyle
Print the font styles.
|
boolean |
printTextForeground
Print the text foreground color.
|
static java.lang.String |
SEPARATOR
Separator constant for use in
header and
footer . |
Constructor and Description |
---|
StyledTextPrintOptions() |
public static final java.lang.String PAGE_TAG
header
and footer
. Value is <page>
public static final java.lang.String SEPARATOR
header
and
footer
. Value is \t
public java.lang.String header
"left '\t' center '\t' right"
left, center, right = <page> | #CDATA
Header and footer are defined as three separate regions for arbitrary
text or the page number placeholder <page>
(StyledTextPrintOptions.PAGE_TAG
). The three regions are
left aligned, centered and right aligned. They are separated by a tab
character (StyledTextPrintOptions.SEPARATOR
).
public java.lang.String footer
"left '\t' center '\t' right"
left, center, right = <page> | #CDATA
Header and footer are defined as three separate regions for arbitrary
text or the page number placeholder <page>
(StyledTextPrintOptions.PAGE_TAG
). The three regions are
left aligned, centered and right aligned. They are separated by a tab
character (StyledTextPrintOptions.SEPARATOR
).
public java.lang.String jobName
public boolean printTextForeground
false
.public boolean printTextBackground
false
.public boolean printTextFontStyle
false
.public boolean printLineBackground
false
.public boolean printLineNumbers
false
.public java.lang.String[] lineLabels