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
This class is used to flatten text markup annotations.Text markup annotations are:
PdfTextMarkupAnnotation.MarkupHighlight
,PdfTextMarkupAnnotation.MarkupUnderline
,PdfTextMarkupAnnotation.MarkupSquiggly
,PdfTextMarkupAnnotation.MarkupStrikeout
.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
AMOUNT_OF_QUAD_POINTS
-
Constructor Summary
Constructors Constructor Description AbstractTextMarkupAnnotationFlattener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static float[]
convertFloatToQuadPoints(Rectangle rectangle)
boolean
flatten(PdfAnnotation annotation, PdfPage page)
Flatten annotation.protected Color
getColor(PdfAnnotation annotation)
static float[]
getQuadPointsAsFloatArray(PdfAnnotation annotation)
Gets the quadpoints as a float array.-
Methods inherited from class com.itextpdf.kernel.utils.annotationsflattening.DefaultAnnotationFlattener
createCanvas, draw
-
-
-
-
Field Detail
-
AMOUNT_OF_QUAD_POINTS
private static final int AMOUNT_OF_QUAD_POINTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 interfaceIAnnotationFlattener
- Overrides:
flatten
in classDefaultAnnotationFlattener
- Parameters:
annotation
- annotation to flattenpage
- 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)
-
-