Top Description Inners Methods
de.rototor.pdfbox.graphics2d

public Interface IPdfBoxGraphics2DPaintApplier

Known Direct Implementers
de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DPaintApplier
Imports
org.apache.pdfbox.pdmodel.PDDocument, .PDPageContentStream, .PDResources, org.apache.pdfbox.pdmodel.graphics.shading.PDShading, java.awt.*, java.awt.geom.AffineTransform, java.io.IOException

Apply the given paint on the Content Stream.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
IPdfBoxGraphics2DPaintApplier.IPaintEnv

The different mappers used by the paint applier.

Method Summary

Modifier and TypeMethod and Description
public PDShading

Returns:

null or a PDShading which should be used to fill a shape.
applyPaint
(Paint
the paint which should be applied
paint
,
PDPageContentStream
the content stream to apply the paint on
contentStream
,
AffineTransform
the current transform of the Graphics2D relative to the contentStream default coordinate space. This is always a copy of the current transform, so we can modify it.
currentTransform
,
IPdfBoxGraphics2DPaintApplier.IPaintEnv
Environment for mapping the paint.
env
)

Apply the paint on the ContentStream

Method Detail

applyPaintback to summary
public PDShading applyPaint(Paint paint, PDPageContentStream contentStream, AffineTransform currentTransform, IPdfBoxGraphics2DPaintApplier.IPaintEnv env) throws IOException

Apply the paint on the ContentStream

Parameters
paint:Paint

the paint which should be applied

contentStream:PDPageContentStream

the content stream to apply the paint on

currentTransform:AffineTransform

the current transform of the Graphics2D relative to the contentStream default coordinate space. This is always a copy of the current transform, so we can modify it.

env:IPdfBoxGraphics2DPaintApplier.IPaintEnv

Environment for mapping the paint.

Returns:PDShading

null or a PDShading which should be used to fill a shape.

Exceptions
IOException:
if its not possible to write the paint into the contentStream
de.rototor.pdfbox.graphics2d back to summary

public Interface IPdfBoxGraphics2DPaintApplier.IPaintEnv

Known Direct Implementers
de.rototor.pdfbox.graphics2d.PdfBoxGraphics2D.PaintEnvImpl

The different mappers used by the paint applier. This interface is implemented internally by PdfBoxGraphics2D

Method Summary

Modifier and TypeMethod and Description
public void
ensureShapeIsWalked()

Call this to ensure that the current shape has been walked on the content stream.

public IPdfBoxGraphics2DColorMapper

Returns:

the color mapper
getColorMapper
()

public Composite
public PDDocument

Returns:

the document
getDocument
()

public PdfBoxGraphics2D

Returns:

The PdfBoxGraphics2D
getGraphics2D
()

public IPdfBoxGraphics2DImageEncoder

Returns:

the image encoder
getImageEncoder
()

public PDResources

Returns:

the resource of the content stream
getResources
()

public Shape

Returns:

get the shape which will be drawn or filled with this paint. Null is returned if no shape is known.
getShapeToDraw
()

The shape information is need to be able to correctly render grandients.

public Color

Returns:

the Graphics2D XOR Mode Color or null if paint mode is active.
getXORMode
()

Method Detail

ensureShapeIsWalkedback to summary
public void ensureShapeIsWalked() throws IOException

Call this to ensure that the current shape has been walked on the content stream. You are not allowed to do any graphics state changes after this, as this would be illegal in PDF. (But most PDF reader render this fine anyway...)
This mostly only needed for ShadedFills

getColorMapperback to summary
public IPdfBoxGraphics2DColorMapper getColorMapper()
Returns:IPdfBoxGraphics2DColorMapper

the color mapper

getCompositeback to summary
public Composite getComposite()
Returns:Composite

the Graphics2D Composite

getDocumentback to summary
public PDDocument getDocument()
Returns:PDDocument

the document

getGraphics2Dback to summary
public PdfBoxGraphics2D getGraphics2D()
Returns:PdfBoxGraphics2D

The PdfBoxGraphics2D

getImageEncoderback to summary
public IPdfBoxGraphics2DImageEncoder getImageEncoder()
Returns:IPdfBoxGraphics2DImageEncoder

the image encoder

getResourcesback to summary
public PDResources getResources()
Returns:PDResources

the resource of the content stream

getShapeToDrawback to summary
public Shape getShapeToDraw()

The shape information is need to be able to correctly render grandients.

Returns:Shape

get the shape which will be drawn or filled with this paint. Null is returned if no shape is known.

getXORModeback to summary
public Color getXORMode()
Returns:Color

the Graphics2D XOR Mode Color or null if paint mode is active.

Annotations
@SuppressWarnings:unused