Class PDAnnotationPolygon
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
-
- org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
-
- org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationPolygon
-
- All Implemented Interfaces:
COSObjectable
public class PDAnnotationPolygon extends PDAnnotationMarkup
-
-
Field Summary
Fields Modifier and Type Field Description private PDAppearanceHandlercustomAppearanceHandlerstatic java.lang.StringSUB_TYPEThe type of annotation.-
Fields inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
RT_GROUP, RT_REPLY
-
-
Constructor Summary
Constructors Constructor Description PDAnnotationPolygon()Constructor.PDAnnotationPolygon(COSDictionary dict)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconstructAppearances()Create the appearance entry for this annotation.voidconstructAppearances(PDDocument document)Create the appearance entry for this annotation.PDBorderEffectDictionarygetBorderEffect()This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line.PDColorgetInteriorColor()This will retrieve the interior color.float[][]getPath()PDF 2.0: This will retrieve the arrays that shall represent the alternating horizontal and vertical coordinates for path building.float[]getVertices()This will retrieve the numbers that shall represent the alternating horizontal and vertical coordinates.voidsetBorderEffect(PDBorderEffectDictionary be)This will set the border effect dictionary, specifying effects to be applied when drawing the line.voidsetCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)Set a custom appearance handler for generating the annotations appearance streams.voidsetInteriorColor(PDColor ic)This will set interior color.voidsetVertices(float[] points)This will set the numbers that shall represent the alternating horizontal and vertical coordinates.-
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
getBorderStyle, getConstantOpacity, getCreationDate, getExternalData, getInReplyTo, getIntent, getPopup, getReplyType, getRichContents, getSubject, getTitlePopup, setBorderStyle, setConstantOpacity, setCreationDate, setExternalData, setInReplyTo, setIntent, setPopup, setReplyType, setRichContents, setSubject, setTitlePopup
-
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
createAnnotation, equals, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getBorder, getColor, getColor, getContents, getCOSObject, getModifiedDate, getNormalAppearanceStream, getOptionalContent, getPage, getRectangle, getStructParent, getSubtype, hashCode, isHidden, isInvisible, isLocked, isLockedContents, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceState, setBorder, setColor, setContents, setHidden, setInvisible, setLocked, setLockedContents, setModifiedDate, setModifiedDate, setNoRotate, setNoView, setNoZoom, setOptionalContent, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setSubtype, setToggleNoView
-
-
-
-
Field Detail
-
SUB_TYPE
public static final java.lang.String SUB_TYPE
The type of annotation.- See Also:
- Constant Field Values
-
customAppearanceHandler
private PDAppearanceHandler customAppearanceHandler
-
-
Constructor Detail
-
PDAnnotationPolygon
public PDAnnotationPolygon()
Constructor.
-
PDAnnotationPolygon
public PDAnnotationPolygon(COSDictionary dict)
Constructor.- Parameters:
dict- The annotations dictionary.
-
-
Method Detail
-
setInteriorColor
public void setInteriorColor(PDColor ic)
This will set interior color.- Parameters:
ic- color.
-
getInteriorColor
public PDColor getInteriorColor()
This will retrieve the interior color.- Returns:
- object representing the color.
-
setBorderEffect
public void setBorderEffect(PDBorderEffectDictionary be)
This will set the border effect dictionary, specifying effects to be applied when drawing the line. This is supported by PDF 1.5 and higher.- Parameters:
be- The border effect dictionary to set.
-
getBorderEffect
public PDBorderEffectDictionary getBorderEffect()
This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line.- Returns:
- The border effect dictionary
-
getVertices
public float[] getVertices()
This will retrieve the numbers that shall represent the alternating horizontal and vertical coordinates.- Returns:
- An array of floats representing the alternating horizontal and vertical coordinates.
-
setVertices
public void setVertices(float[] points)
This will set the numbers that shall represent the alternating horizontal and vertical coordinates.- Parameters:
points- an array with the numbers that shall represent the alternating horizontal and vertical coordinates.
-
getPath
public float[][] getPath()
PDF 2.0: This will retrieve the arrays that shall represent the alternating horizontal and vertical coordinates for path building.- Returns:
- An array of float arrays, each supplying the operands for a path building operator (m, l or c). The first array should have 2 elements, the others should have 2 or 6 elements.
-
setCustomAppearanceHandler
public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)
Set a custom appearance handler for generating the annotations appearance streams.- Parameters:
appearanceHandler- custom appearance handler
-
constructAppearances
public void constructAppearances()
Description copied from class:PDAnnotationCreate the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.- Overrides:
constructAppearancesin classPDAnnotation
-
constructAppearances
public void constructAppearances(PDDocument document)
Description copied from class:PDAnnotationCreate the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.- Overrides:
constructAppearancesin classPDAnnotation- Parameters:
document- the related document
-
-