Package de.rototor.pdfbox.graphics2d
Interface IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv
-
- Enclosing interface:
- IPdfBoxGraphics2DFontTextDrawer
public static interface IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv
Enviroment for font based drawing of text
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyPaint(Paint paint, Shape shapeToDraw)
Apply the given paint on the current content streamvoid
applyStroke(Stroke stroke)
Apply this stroke on the current content streamGraphics2D
getCalculationGraphics()
org.apache.pdfbox.pdmodel.PDPageContentStream
getContentStream()
AffineTransform
getCurrentEffectiveTransform()
org.apache.pdfbox.pdmodel.PDDocument
getDocument()
Font
getFont()
FontRenderContext
getFontRenderContext()
org.apache.pdfbox.pdmodel.common.PDRectangle
getGraphicsBBox()
Paint
getPaint()
org.apache.pdfbox.pdmodel.PDResources
getResources()
-
-
-
Method Detail
-
getDocument
org.apache.pdfbox.pdmodel.PDDocument getDocument()
- Returns:
- the document we are writing to
-
getContentStream
org.apache.pdfbox.pdmodel.PDPageContentStream getContentStream()
- Returns:
- the content stream
-
getFont
Font getFont()
- Returns:
- the current font set on the graphics. This is the "default" font to
use when no other font is set on the
AttributedCharacterIterator
.
-
getPaint
Paint getPaint()
- Returns:
- the current paint set on the graphics. This is the "default" paint
when no other paint is set on on the
AttributedCharacterIterator
.
-
applyPaint
void applyPaint(Paint paint, Shape shapeToDraw) throws IOException
Apply the given paint on the current content stream- Parameters:
paint
- Paint to applyshapeToDraw
- the shape to draw of the text, if known. This is needed to calculate correct gradients.- Throws:
IOException
- if an IO error occurs when writing the paint to the content stream.
-
getFontRenderContext
FontRenderContext getFontRenderContext()
- Returns:
- the
Graphics2D
FontRenderContext
-
getGraphicsBBox
org.apache.pdfbox.pdmodel.common.PDRectangle getGraphicsBBox()
- Returns:
- the bbox of the
PdfBoxGraphics2D
-
getResources
org.apache.pdfbox.pdmodel.PDResources getResources()
- Returns:
- the resource of the content stream
-
getCalculationGraphics
Graphics2D getCalculationGraphics()
- Returns:
- the default calcuation BufferedImage based graphics.
-
applyStroke
void applyStroke(Stroke stroke) throws IOException
Apply this stroke on the current content stream- Parameters:
stroke
- the stroke to apply- Throws:
IOException
-
getCurrentEffectiveTransform
AffineTransform getCurrentEffectiveTransform()
- Returns:
- the current transform active to draw on this stream
-
-