Use StyledTextPrintOptions to specify printing options for the StyledText.print(Printer, StyledTextPrintOptions) API.
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();
@since 2.1