Class PDAnnotationCaret
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationCaret
- All Implemented Interfaces:
COSObjectable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PDAppearanceHandlerstatic final StringThe type of annotation.Fields inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
RT_GROUP, RT_REPLY -
Constructor Summary
ConstructorsConstructorDescriptionPDAnnotationCaret(COSDictionary field) Creates a Caret annotation from a COSDictionary, expected to be a correct object definition. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate the appearance entry for this annotation.voidconstructAppearances(PDDocument document) Create the appearance entry for this annotation.float[]This will get the margin between the annotations "outer" rectangle defined by /Rect and the boundaries of the underlying caret.voidsetCustomAppearanceHandler(PDAppearanceHandler appearanceHandler) Set a custom appearance handler for generating the annotations appearance streams.voidsetRectDifferences(float difference) This will set the difference between the annotations "outer" rectangle defined by /Rect and boundaries of the underlying.voidsetRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom) This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.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, setTitlePopupMethods 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 Details
-
SUB_TYPE
The type of annotation.- See Also:
-
customAppearanceHandler
-
-
Constructor Details
-
PDAnnotationCaret
public PDAnnotationCaret() -
PDAnnotationCaret
Creates a Caret annotation from a COSDictionary, expected to be a correct object definition.- Parameters:
field- the PDF object to represent as a field.
-
-
Method Details
-
setRectDifferences
public void setRectDifferences(float difference) This will set the difference between the annotations "outer" rectangle defined by /Rect and boundaries of the underlying.This will set an equal difference for all sides
- Parameters:
difference- from the annotations /Rect entry
-
setRectDifferences
public void setRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom) This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.- Parameters:
differenceLeft- left difference from the annotations /Rect entrydifferenceTop- top difference from the annotations /Rect entrydifferenceRight- right difference from the annotations /Rect entrydifferenceBottom- bottom difference from the annotations /Rect entry
-
getRectDifferences
public float[] getRectDifferences()This will get the margin between the annotations "outer" rectangle defined by /Rect and the boundaries of the underlying caret.- Returns:
- the differences. If the entry hasn't been set am empty array is returned.
-
setCustomAppearanceHandler
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
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
-