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 iText Java library.
The target give access to the
PDFContentBype
object from itext to draw items.When this target is instanciated it uses property values defined in the
PreviewProperties
. Namely is usesMARGIN_LEFT
,MARGIN_TOP
,MARGIN_BOTTOM
,MARGIN_RIGHT
,LANDCAPE
andPAGESIZE
.- Author:
- Yudi Xue, Mathieu Bastian
-
-
Field Summary
Fields Modifier and Type Field Description static String
LANDSCAPE
static String
MARGIN_BOTTOM
static String
MARGIN_LEFT
static String
MARGIN_RIGHT
static String
MARGIN_TOP
static String
PAGESIZE
static String
PDF_CONTENT_BYTE
-
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 com.itextpdf.text.pdf.BaseFont
getBaseFont(Font font)
Get a the equivalent in iText of the Java font.com.itextpdf.text.pdf.PdfContentByte
getContentByte()
Returns thePDFContentBype
instance of the PDFTarget.float
getMarginBottom()
Returns the margin at the bottom of the page.float
getMarginLeft()
Returns the margin at the left of the page.float
getMarginRight()
Returns the margin at the right of the page.float
getMarginTop()
Returns the margin at the top of the page.com.itextpdf.text.Rectangle
getPageSize()
Returns the page's size.boolean
isLandscape()
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
-
-
Method Detail
-
getContentByte
com.itextpdf.text.pdf.PdfContentByte getContentByte()
Returns thePDFContentBype
instance of the PDFTarget. PDFContentByte offers a set of drawing functions which can be used by Renderer objects.- Returns:
- a PDFContentBype object
-
getBaseFont
com.itextpdf.text.pdf.BaseFont getBaseFont(Font font)
Get a the equivalent in iText of the Java font. Base fonts are either Type 1 fonts (PDF default's font) or valid system fonts. The first time a base font which is not a Type 1 is requested the system will register the system fonts in order to find the right font. This might take some time up to a minute.If
font
can't be found in iText's default fonts or registered fonts it returns the default Helvetica font.- Parameters:
font
- the reference Java font- Returns:
- the iText BaseFont, 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:
true
if the orientation is landscape,false
if portrait.
-
getPageSize
com.itextpdf.text.Rectangle getPageSize()
Returns the page's size.- Returns:
- the page size
-
-