Class DefaultAnnotationFlattener

java.lang.Object
com.itextpdf.kernel.utils.annotationsflattening.DefaultAnnotationFlattener
All Implemented Interfaces:
IAnnotationFlattener
Direct Known Subclasses:
AbstractTextMarkupAnnotationFlattener

public class DefaultAnnotationFlattener extends 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.
  • Constructor Details

  • Method Details

    • flatten

      public boolean flatten (PdfAnnotation annotation, PdfPage page)
      Flatten annotation.
      Specified by:
      flatten in interface IAnnotationFlattener
      Parameters:
      annotation - annotation to flatten
      page - 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 draw
      page - page to draw annotation on
      Returns:
      true if annotation was drawn, false otherwise