Module org.sejda.sambox
Class PDAnnotationSquareCircle
java.lang.Object
org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotation
org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotationMarkup
org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotationSquareCircle
- All Implemented Interfaces:
COSObjectable
This is the class that represents a rectangular or eliptical annotation Introduced in PDF 1.3 specification .
- Author:
- Paul King
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for an elliptical type of annotation.static final StringConstant for a Rectangular type of annotation.Fields inherited from class org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotationMarkup
IT_FREE_TEXT, IT_FREE_TEXT_CALLOUT, IT_FREE_TEXT_TYPE_WRITER, RT_GROUP, RT_REPLY, SUB_TYPE_CARET, SUB_TYPE_FREETEXT, SUB_TYPE_INK, SUB_TYPE_POLYGON, SUB_TYPE_POLYLINE, SUB_TYPE_SOUNDFields inherited from class org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotation
FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_LOCKED, FLAG_NO_ROTATE, FLAG_NO_VIEW, FLAG_NO_ZOOM, FLAG_PRINTED, FLAG_READ_ONLY, FLAG_TOGGLE_NO_VIEW -
Constructor Summary
ConstructorsConstructorDescriptionPDAnnotationSquareCircle(String subType) Creates a Circle or Square annotation of the specified sub type.Creates a Line annotation from a COSDictionary, expected to be a correct object definition. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate the appearance entry for this annotation.This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line.This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.This will retrieve the interior color of the drawn area color is in DeviceRGB color space.This will get the rectangle difference rectangle.float[]This will get the differences between the annotations "outer" rectangle defined by /Rect and the border.This will retrieve the sub type (and hence appearance, AP taking precedence) For this annotation.voidThis will set the border effect dictionary, specifying effects to be applied when drawing the line.voidThis will set the border style dictionary, specifying the width and dash pattern used in drawing the line.voidsetCustomAppearanceHandler(PDAppearanceHandler appearanceHandler) Set a custom appearance handler for generating the annotations appearance streams.voidThis will set interior color of the drawn area color is in DeviceRGB colo rspace.voidThis will set the rectangle difference rectangle.voidsetRectDifferences(float difference) This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.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.voidsetSubtype(String subType) This will set the sub type (and hence appearance, AP taking precedence) For this annotation.Methods inherited from class org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotationMarkup
getCallout, getConstantOpacity, getCreationDate, getDefaultAppearance, getDefaultStyleString, getEndPointEndingStyle, getExternalData, getInkList, getInReplyTo, getIntent, getLineEndingStyle, getPath, getPopup, getQ, getReplyType, getRichContents, getStartPointEndingStyle, getSubject, getTitlePopup, getVertices, setCallout, setConstantOpacity, setCreationDate, setDefaultAppearance, setDefaultStyleString, setEndPointEndingStyle, setExternalData, setInkList, setInReplyTo, setIntent, setLineEndingStyle, setPopup, setQ, setReplyType, setRichContents, setStartPointEndingStyle, setSubject, setTitlePopup, setVerticesMethods inherited from class org.sejda.sambox.pdmodel.interactive.annotation.PDAnnotation
createAnnotation, createAnnotation, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getBorder, getColor, getColor, getContents, getModifiedDate, getNormalAppearanceStream, getOptionalContent, getPage, getRectangle, getStructParent, 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, setToggleNoViewMethods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Field Details
-
SUB_TYPE_SQUARE
Constant for a Rectangular type of annotation.- See Also:
-
SUB_TYPE_CIRCLE
Constant for an elliptical type of annotation.- See Also:
-
-
Constructor Details
-
PDAnnotationSquareCircle
Creates a Circle or Square annotation of the specified sub type.- Parameters:
subType- the subtype the annotation represents.
-
PDAnnotationSquareCircle
Creates a Line annotation from a COSDictionary, expected to be a correct object definition.- Parameters:
field- the PDF object to represent as a field.
-
-
Method Details
-
setInteriorColor
This will set interior color of the drawn area color is in DeviceRGB colo rspace.- Overrides:
setInteriorColorin classPDAnnotationMarkup- Parameters:
ic- color in the DeviceRGB color space.
-
getInteriorColor
This will retrieve the interior color of the drawn area color is in DeviceRGB color space.- Overrides:
getInteriorColorin classPDAnnotationMarkup- Returns:
- object representing the color.
-
setBorderEffect
This will set the border effect dictionary, specifying effects to be applied when drawing the line.- Overrides:
setBorderEffectin classPDAnnotationMarkup- Parameters:
be- The border effect dictionary to set.
-
getBorderEffect
This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line.- Overrides:
getBorderEffectin classPDAnnotationMarkup- Returns:
- The border effect dictionary
-
setRectDifference
This will set the rectangle difference rectangle. Giving the difference between the annotations rectangle and where the drawing occurs. (To take account of any effects applied through the BE entry forexample)- Overrides:
setRectDifferencein classPDAnnotationMarkup- Parameters:
rd- the rectangle difference
-
getRectDifference
This will get the rectangle difference rectangle. Giving the difference between the annotations rectangle and where the drawing occurs. (To take account of any effects applied through the BE entry forexample)- Overrides:
getRectDifferencein classPDAnnotationMarkup- Returns:
- the rectangle difference
-
setSubtype
This will set the sub type (and hence appearance, AP taking precedence) For this annotation. See the SUB_TYPE_XXX constants for valid values.- Parameters:
subType- The subtype of the annotation
-
getSubtype
This will retrieve the sub type (and hence appearance, AP taking precedence) For this annotation.- Overrides:
getSubtypein classPDAnnotation- Returns:
- The subtype of this annotation, see the SUB_TYPE_XXX constants.
-
setBorderStyle
This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.- Overrides:
setBorderStylein classPDAnnotationMarkup- Parameters:
bs- the border style dictionary to set. TODO not all annotations may have a BS entry
-
getBorderStyle
This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.- Overrides:
getBorderStylein classPDAnnotationMarkup- Returns:
- the border style dictionary. TODO not all annotations may have a BS entry
-
setRectDifferences
public void setRectDifferences(float difference) This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.This will set an equal difference for all sides
- Overrides:
setRectDifferencesin classPDAnnotationMarkup- 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.- Overrides:
setRectDifferencesin classPDAnnotationMarkup- 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 differences between the annotations "outer" rectangle defined by /Rect and the border.- Overrides:
getRectDifferencesin classPDAnnotationMarkup- 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.- Overrides:
setCustomAppearanceHandlerin classPDAnnotationMarkup- Parameters:
appearanceHandler-
-
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 classPDAnnotationMarkup
-