public class TextRenderer
extends java.lang.Object
implements java.awt.print.Pageable, java.awt.print.Printable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FONTFAMILY |
static int |
FONTSIZE |
static int |
FONTSTYLE |
static float |
LINESPACEFACTOR |
Constructor and Description |
---|
TextRenderer(java.io.Reader stream,
java.awt.print.PageFormat format)
Create a PageableText object for a stream of text
|
TextRenderer(java.lang.String text,
java.awt.print.PageFormat format)
Create a PageableText object for a string of text
|
TextRenderer(java.net.URL fileURL,
java.awt.print.PageFormat format)
Create a PageableText object for a file of text
|
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfPages() |
java.awt.print.PageFormat |
getPageFormat(int pagenum) |
java.awt.print.Printable |
getPrintable(int pagenum) |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat format,
int pagenum)
This is the print() method of the Printable interface.
|
public static java.lang.String FONTFAMILY
public static int FONTSIZE
public static int FONTSTYLE
public static float LINESPACEFACTOR
public TextRenderer(java.lang.String text, java.awt.print.PageFormat format) throws java.io.IOException
java.io.IOException
public TextRenderer(java.net.URL fileURL, java.awt.print.PageFormat format) throws java.io.IOException
java.io.IOException
public TextRenderer(java.io.Reader stream, java.awt.print.PageFormat format) throws java.io.IOException
java.io.IOException
public int getNumberOfPages()
getNumberOfPages
in interface java.awt.print.Pageable
public java.awt.print.PageFormat getPageFormat(int pagenum)
getPageFormat
in interface java.awt.print.Pageable
public java.awt.print.Printable getPrintable(int pagenum)
getPrintable
in interface java.awt.print.Pageable
public int print(java.awt.Graphics g, java.awt.print.PageFormat format, int pagenum)
print
in interface java.awt.print.Printable