public class PDFOutput extends Output
Output
that can be used to plot graphs to a PDFCanvas
object, which can be included in our companion PDF Library.
For example, to create a simple PDF with a graph on the first page:
PDF pdf = new PDF(); PDFPage page = pdf.newPage("A4"); PDFCanvas canvas = new PDFCanvas(400,400); graph.draw(new PDFOutput(canvas)); page.drawCanvas(canvas, 100, 200, 500, 700); pdf.render(outputstream);
Constructor and Description |
---|
PDFOutput(PDFCanvas canvas)
Create a new PDFOutput that will write the graph to the specified
PDFCanvas . |
Modifier and Type | Method and Description |
---|---|
void |
setFont(String name,
PDFFont font)
Define a custom font for use with this output class.
|
void |
setTexturePaintDPI(int imagedpi)
Set the resolution at which
TexturePaint paints are supposed
to be converted to bitmap. |
getAreas, storeAreas
public void setTexturePaintDPI(int imagedpi)
TexturePaint
paints are supposed
to be converted to bitmap. The default value is 72public void setFont(String name, PDFFont font)
output.setFont("myfont", new OpenTypeFont(new FileInputStream("myfont.ttf"), 2));
name
- the name of the font, as passed to TextStyle.setFont(java.lang.String, double)
. A
name of "Default" will override the default font. The name is case-insensitivefont
- the PDFFont object to useCopyright © 2001-2016 Big Faceless Organization