Package org.gephi.preview.api
Interface PDFTarget
-
- All Superinterfaces:
RenderTarget
public interface PDFTarget extends RenderTarget
Rendering target to PDF format.This target is used by renderers objects to render a graph to PDF and uses the PDFBox Java library.
The target give access to the
PDPageContentStreamobject from PDFBox to draw items.When this target is instantiated it uses property values defined in the
PreviewProperties. Namely is usesMARGIN_LEFT,MARGIN_TOP,MARGIN_BOTTOM,MARGIN_RIGHT,LANDSCAPEandPAGESIZE.- Author:
- Yudi Xue, Mathieu Bastian
-
-
Field Summary
Fields Modifier and Type Field Description static StringLANDSCAPEstatic StringMARGIN_BOTTOMstatic StringMARGIN_LEFTstatic StringMARGIN_RIGHTstatic StringMARGIN_TOPstatic StringPAGESIZEstatic StringPDF_CONTENT_BYTEstatic StringPDF_DOCUMENTstatic StringTRANSPARENT_BACKGROUND-
Fields inherited from interface org.gephi.preview.api.RenderTarget
G2D_TARGET, PDF_TARGET, SVG_TARGET
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.pdfbox.pdmodel.PDPageContentStreamgetContentStream()Returns thePDPageContentStreaminstance of the PDFTarget.floatgetMarginBottom()Returns the margin at the bottom of the page.floatgetMarginLeft()Returns the margin at the left of the page.floatgetMarginRight()Returns the margin at the right of the page.floatgetMarginTop()Returns the margin at the top of the page.org.apache.pdfbox.pdmodel.common.PDRectanglegetPageSize()Returns the page's size.org.apache.pdfbox.pdmodel.font.PDFontgetPDFont(Font font)Get the PDFBox equivalent the Java font.booleanisLandscape()Returns whether the orientation is in landscape or portrait.
-
-
-
Field Detail
-
PDF_CONTENT_BYTE
static final String PDF_CONTENT_BYTE
- See Also:
- Constant Field Values
-
MARGIN_LEFT
static final String MARGIN_LEFT
- See Also:
- Constant Field Values
-
MARGIN_TOP
static final String MARGIN_TOP
- See Also:
- Constant Field Values
-
MARGIN_BOTTOM
static final String MARGIN_BOTTOM
- See Also:
- Constant Field Values
-
MARGIN_RIGHT
static final String MARGIN_RIGHT
- See Also:
- Constant Field Values
-
LANDSCAPE
static final String LANDSCAPE
- See Also:
- Constant Field Values
-
PAGESIZE
static final String PAGESIZE
- See Also:
- Constant Field Values
-
PDF_DOCUMENT
static final String PDF_DOCUMENT
- See Also:
- Constant Field Values
-
TRANSPARENT_BACKGROUND
static final String TRANSPARENT_BACKGROUND
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContentStream
org.apache.pdfbox.pdmodel.PDPageContentStream getContentStream()
Returns thePDPageContentStreaminstance of the PDFTarget. PDPageContentStream offers a set of drawing functions which can be used by Renderer objects.- Returns:
- a PDPageContentStream object
-
getPDFont
org.apache.pdfbox.pdmodel.font.PDFont getPDFont(Font font)
Get the PDFBox equivalent the Java font.If
fontcan't be found it returns the default Helvetica font.Note that each font (regardless of font size) is embedded in the PDF Document. Also note that some fonts might miss Unicode characters, which will prevent the text from being rendered properly.
- Parameters:
font- the reference Java font- Returns:
- the PDFont, or Helvetica is not found
-
getMarginBottom
float getMarginBottom()
Returns the margin at the bottom of the page.- Returns:
- the bottom margin, in pixels
-
getMarginLeft
float getMarginLeft()
Returns the margin at the left of the page.- Returns:
- the left margin, in pixels
-
getMarginRight
float getMarginRight()
Returns the margin at the right of the page.- Returns:
- the right margin, in pixels
-
getMarginTop
float getMarginTop()
Returns the margin at the top of the page.- Returns:
- the top margin, in pixels
-
isLandscape
boolean isLandscape()
Returns whether the orientation is in landscape or portrait.- Returns:
trueif the orientation is landscape,falseif portrait.
-
getPageSize
org.apache.pdfbox.pdmodel.common.PDRectangle getPageSize()
Returns the page's size.- Returns:
- the page size
-
-