org.faceless.graph2
Class PDFOutput
java.lang.Object
org.faceless.graph2.Output
org.faceless.graph2.PDFOutput
public class PDFOutput
- extends Output
A subclass of 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);
Method Summary |
void |
setFont(String name,
PDFFont font)
Define a custom font for use with this output class. |
PDFOutput
public PDFOutput(PDFCanvas canvas)
- Create a new PDFOutput that will write the graph to the specified
PDFCanvas
.
This canvas can then be drawn onto pages in the document at any scale or position
- Parameters:
canvas
- the PDFCanvas to draw on
setFont
public void setFont(String name,
PDFFont font)
- Define a custom font for use with this output class. Here's an example:
output.setFont("myfont", new OpenTypeFont(new FileInputStream("myfont.ttf"), 2));
- Parameters:
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 use- Since:
- 1.0.3
Copyright © 2001-2011 Big Faceless Organization