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 |
|---|---|
| public String | footer
Formatted text to print in the footer of each page. |
| public String | header
Formatted text to print in the header of each page. |
| public String | jobName
Name of the print job. |
| public String[] | lineLabels
Labels used for printing line numbers. |
| public static final String | PAGE_TAG
Page number placeholder constant for use in |
| public boolean | printLineBackground
Print the line background color. |
| public boolean | printLineNumbers
Print line numbers. |
| public boolean | printTextBackground
Print the text background color. |
| public boolean | printTextFontStyle
Print the font styles. |
| public boolean | printTextForeground
Print the text foreground color. |
| public static final String | SEPARATOR
Separator constant for use in |
| Access | Constructor and Description |
|---|---|
| public |
| footer | back to summary |
|---|---|
| public String footer Formatted text to print in the footer of each page. "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>
( | |
| header | back to summary |
|---|---|
| public String header Formatted text to print in the header of each page. "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>
( | |
| jobName | back to summary |
|---|---|
| public String jobName Name of the print job. | |
| lineLabels | back to summary |
|---|---|
| public String[] lineLabels Labels used for printing line numbers.
| |
| PAGE_TAG | back to summary |
|---|---|
| public static final String PAGE_TAG Page number placeholder constant for use in | |
| printLineBackground | back to summary |
|---|---|
| public boolean printLineBackground Print the line background color. Default value is | |
| printLineNumbers | back to summary |
|---|---|
| public boolean printLineNumbers Print line numbers. Default value is
| |
| printTextBackground | back to summary |
|---|---|
| public boolean printTextBackground Print the text background color. Default value is | |
| printTextFontStyle | back to summary |
|---|---|
| public boolean printTextFontStyle Print the font styles. Default value is | |
| printTextForeground | back to summary |
|---|---|
| public boolean printTextForeground Print the text foreground color. Default value is | |
| SEPARATOR | back to summary |
|---|---|
| public static final String SEPARATOR Separator constant for use in | |
| StyledTextPrintOptions | back to summary |
|---|---|
| public StyledTextPrintOptions() | |