Class AbstractTextMarkupAnnotationFlattener

java.lang.Object
com.itextpdf.kernel.utils.annotationsflattening.DefaultAnnotationFlattener
com.itextpdf.kernel.utils.annotationsflattening.AbstractTextMarkupAnnotationFlattener
All Implemented Interfaces:
IAnnotationFlattener
Direct Known Subclasses:
HighLightTextMarkupAnnotationFlattener, SquigglyTextMarkupAnnotationFlattener, StrikeOutTextMarkupAnnotationFlattener, UnderlineTextMarkupAnnotationFlattener

public abstract class AbstractTextMarkupAnnotationFlattener extends DefaultAnnotationFlattener
  • Field Details

  • Constructor Details

    • AbstractTextMarkupAnnotationFlattener

      public AbstractTextMarkupAnnotationFlattener()
  • Method Details

    • getQuadPointsAsFloatArray

      public static float[] getQuadPointsAsFloatArray(PdfAnnotation annotation)
      Gets the quadpoints as a float array. if the annotation has no quadpoints, returns the annotation rectangle converted to the same notation as the quadpoints.
      Parameters:
      annotation - the annotation
      Returns:
      the quadpoints as float array
    • flatten

      public boolean flatten(PdfAnnotation annotation, PdfPage page)
      Flatten annotation.
      Specified by:
      flatten in interface IAnnotationFlattener
      Overrides:
      flatten in class DefaultAnnotationFlattener
      Parameters:
      annotation - annotation to flatten
      page - page to flatten annotation on
      Returns:
      true if annotation was flattened, false otherwise
    • getColor

      protected Color getColor(PdfAnnotation annotation)
      Parameters:
      annotation - the annotation to extract the color from.
      Returns:
      the color or null if the colorspace is invalid
    • convertFloatToQuadPoints

      private static float[] convertFloatToQuadPoints(Rectangle rectangle)