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
Modifier and TypeMethodDescriptionvoid
applyPaint
(Paint paint, Shape shapeToDraw) Apply the given paint on the current content streamvoid
applyStroke
(Stroke stroke) Apply this stroke on the current content streamorg.apache.pdfbox.pdmodel.PDPageContentStream
org.apache.pdfbox.pdmodel.PDDocument
getFont()
org.apache.pdfbox.pdmodel.common.PDRectangle
getPaint()
org.apache.pdfbox.pdmodel.PDResources
-
Method Details
-
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
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
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
-