public class AnnotationDrawListener extends Object implements DrawListener, RenderListener
draw() methods, in order collect all annotation metadata. After all drawing
is done, you have to call finalizeAnnotations() which creates all
necessary annotations and sets them to the corresponding pages. This listener
is used by the the rendering API, but you may also use it with the low-level
text API.| Constructor and Description |
|---|
AnnotationDrawListener(DrawContext drawContext)
Creates an AnnotationDrawListener with the given
DrawContext. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPage(RenderContext renderContext)
Called after any rendering is performed to the page.
|
void |
afterRender() |
void |
beforePage(RenderContext renderContext)
Called before any rendering is performed to the page.
|
void |
drawn(Object drawnObject,
Position upperLeft,
float width,
float height)
Indicates that an object has been drawn.
|
void |
finalizeAnnotations()
Deprecated.
user
afterRender() instead. |
public AnnotationDrawListener(DrawContext drawContext)
DrawContext.drawContext - the context which provides the PDDocument and the
PDPage currently drawn to.public void drawn(Object drawnObject, Position upperLeft, float width, float height)
DrawListenerdrawn in interface DrawListenerdrawnObject - the drawn object.upperLeft - the upper left position.width - the width of the drawn object.height - the height of the drawn object.@Deprecated public void finalizeAnnotations() throws IOException
afterRender() instead.IOException - by pdfbox.public void beforePage(RenderContext renderContext) throws IOException
RenderListenerbeforePage in interface RenderListenerrenderContext - the context providing all rendering state.IOException - by pdfbox.public void afterPage(RenderContext renderContext) throws IOException
RenderListenerafterPage in interface RenderListenerrenderContext - the context providing all rendering state.IOException - by pdfbox.public void afterRender()
throws IOException
IOExceptionCopyright © 2021. All rights reserved.