Package org.faceless.graph2
Class PDFOutput
- java.lang.Object
-
- org.faceless.graph2.Output
-
- org.faceless.graph2.PDFOutput
-
public class PDFOutput extends Output
A subclass ofOutput
that can be used to plot graphs to aPDFCanvas
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
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 whichTexturePaint
paints are supposed to be converted to bitmap.-
Methods inherited from class org.faceless.graph2.Output
getAreas, storeAreas
-
-
-
-
Method Detail
-
setTexturePaintDPI
public void setTexturePaintDPI(int imagedpi)
Set the resolution at whichTexturePaint
paints are supposed to be converted to bitmap. The default value is 72- Since:
- 2.4.8
-
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 toTextStyle.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
-
-