Class DefaultAnnotationFlattener
- java.lang.Object
-
- com.itextpdf.kernel.utils.annotationsflattening.DefaultAnnotationFlattener
-
- All Implemented Interfaces:
IAnnotationFlattener
- Direct Known Subclasses:
AbstractTextMarkupAnnotationFlattener
public class DefaultAnnotationFlattener extends java.lang.Object implements IAnnotationFlattener
This class is used to flatten annotations. The default implementation first tries to draw the normal appearance stream of the annotation. If the normal appearance stream is not present, then it tries to draw the annotation using the fallback implementation.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description DefaultAnnotationFlattener()
Creates a newDefaultAnnotationFlattener
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PdfCanvas
createCanvas(PdfPage page)
Creates a canvas.protected boolean
draw(PdfAnnotation annotation, PdfPage page)
Draws annotation.boolean
flatten(PdfAnnotation annotation, PdfPage page)
Flatten annotation.
-
-
-
Constructor Detail
-
DefaultAnnotationFlattener
public DefaultAnnotationFlattener()
Creates a newDefaultAnnotationFlattener
instance.
-
-
Method Detail
-
flatten
public boolean flatten(PdfAnnotation annotation, PdfPage page)
Flatten annotation.- Specified by:
flatten
in interfaceIAnnotationFlattener
- Parameters:
annotation
- annotation to flattenpage
- page to flatten annotation on- Returns:
- true if annotation was flattened, false otherwise
-
createCanvas
protected PdfCanvas createCanvas(PdfPage page)
Creates a canvas. It will draw above the other items on the canvas.- Parameters:
page
- the page to draw the annotation on- Returns:
- the
PdfCanvas
the annotation will be drawn upon.
-
draw
protected boolean draw(PdfAnnotation annotation, PdfPage page)
Draws annotation. This method is called if the normal appearance stream of the annotation is not present. The default implementation returns false.- Parameters:
annotation
- annotation to drawpage
- page to draw annotation on- Returns:
- true if annotation was drawn, false otherwise
-
-