Class DefaultAnnotationFlattener
java.lang.Object
com.itextpdf.kernel.utils.annotationsflattening.DefaultAnnotationFlattener
- All Implemented Interfaces:
-
IAnnotationFlattener
- Direct Known Subclasses:
-
AbstractTextMarkupAnnotationFlattener
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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
DefaultAnnotationFlattener
public DefaultAnnotationFlattener()Creates a newDefaultAnnotationFlattener
instance.
-
-
Method Details
-
flatten
Flatten annotation.- Specified by:
-
flatten
in interfaceIAnnotationFlattener
- Parameters:
-
annotation
- annotation to flatten -
page
- page to flatten annotation on - Returns:
- true if annotation was flattened, false otherwise
-
createCanvas
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
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 draw -
page
- page to draw annotation on - Returns:
- true if annotation was drawn, false otherwise
-