public class Annotation
extends java.lang.Object
| Constructor and Description |
|---|
Annotation(Page page,
java.lang.String subtype,
Rect initialRect)
Create a new Annotation at the end of a page's annotation array.
|
Annotation(Page page,
java.lang.String subtype,
Rect initialRect,
int addAfter)
Create a new Annotation at a specific index in the page's annotation array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
boolean |
equals(java.lang.Object rhs) |
Form |
generateAppearance()
Generate a new appearance stream with the current annotation properties.
|
double |
getAnnotationFeatureLevel()
The minimum PDF version necessary to support the features used in this annotation.
|
Color |
getColor()
The color of the annotation.
|
java.lang.String |
getContents()
The text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form.
|
java.util.EnumSet<AnnotationFlags> |
getFlags()
The flags for the annotation.
|
Color |
getInteriorColor()
The interior color with which to fill the annotation's line endings.
|
Form |
getNormalAppearance() |
double |
getOpacity()
The optional constant opacity value that shall be used in painting a Markup annotation.
|
OptionalContentMembershipDict |
getOptionalContentMembershipDict()
The OptionalContentMembershipDict property for this Annotation.
|
PDFDict |
getPDFDict()
Retrieve the PDFObject representation of this object
|
Rect |
getRect()
The size and location of the annotation on its page
|
java.lang.String |
getSubtype()
The annotation's subtype
|
java.lang.String |
getTitle()
The title of the annotation.
|
boolean |
hasRichTextData()
Checks the annotation for Rich Text String content (PDFReference 1.7 Section 8.6.2).
|
boolean |
isCurrentlyVisible(OptionalContentContext occ)
Tests whether an annotation is visible in a given optional content context, considering the current ON-OFF states of the optional-content groups in the optional-content dictionary (OCMD) and the dictionary's visibility policy.
|
void |
setAnnotationFeatureLevel(double featureLevel)
Removes features not supported in the supplied version number.
|
void |
setColor(Color arg0)
The color of the annotation.
|
void |
setContents(java.lang.String arg0)
The text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form.
|
void |
setFlags(java.util.EnumSet<AnnotationFlags> arg0)
The flags for the annotation.
|
void |
setInteriorColor(Color color)
The interior color with which to fill the annotation's line endings.
|
void |
setNormalAppearance(Form form) |
void |
setOpacity(double opacityValue)
The optional constant opacity value that shall be used in painting a Markup annotation.
|
void |
setOptionalContentMembershipDict(OptionalContentMembershipDict ocmd)
The OptionalContentMembershipDict property for this Annotation.
|
void |
setRect(Rect rect)
The size and location of the annotation on its page
|
void |
setTitle(java.lang.String title)
The title of the annotation.
|
java.lang.String |
toString() |
public Annotation(Page page, java.lang.String subtype, Rect initialRect)
page - The page to which the annotation is added.subtype - The type of the annotation.initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.public Annotation(Page page, java.lang.String subtype, Rect initialRect, int addAfter)
page - The page to which the annotation is added.subtype - The type of the annotation.initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.addAfter - Where to add the annotation in the page's annotation array.public void delete()
public boolean equals(java.lang.Object rhs)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getTitle()
public void setTitle(java.lang.String title)
public java.lang.String getContents()
public void setContents(java.lang.String arg0)
public Color getColor()
public void setColor(Color arg0)
public java.util.EnumSet<AnnotationFlags> getFlags()
public void setFlags(java.util.EnumSet<AnnotationFlags> arg0)
public Rect getRect()
public void setRect(Rect rect)
public java.lang.String getSubtype()
public boolean isCurrentlyVisible(OptionalContentContext occ)
If the annotation occurs more than once within the content, this method only checks the visibility of the first occurrence of the annotation.
This method determines visibility without considering the visbility of the Content object that the annotation belongs to. To determine the visibility of an annotation while taking the Content's visibility into consideration, use the alternate version of this method.
public Form getNormalAppearance()
public void setNormalAppearance(Form form)
public Form generateAppearance()
The resulting Form can then be used to set the annotation's appearance, such as by calling SetNormalAppearance.
public Color getInteriorColor()
The color of the line itself can be retrieved from Annotation.Color.
public void setInteriorColor(Color color)
Only RGB colors are allowed.
The color of the line itself can be retrieved from Annotation.Color.
public double getAnnotationFeatureLevel()
public void setAnnotationFeatureLevel(double featureLevel)
public PDFDict getPDFDict()
public double getOpacity()
Opacity is a range from 0.0 (fully transparent) to 1.0 (fully opaque).
public void setOpacity(double opacityValue)
Opacity is a range from 0.0 (fully transparent) to 1.0 (fully opaque).
public OptionalContentMembershipDict getOptionalContentMembershipDict()
Setting this property will attach the Annotation to an OptionalContentMembershipDict; it will then be associated with the OptionalContentGroups and be subject to the VisibilityPolicy and VisibilityExpression of that MembershipDict.
By setting this property to null, the Annotation is detached from any OptionalContentMembershipDict.
public void setOptionalContentMembershipDict(OptionalContentMembershipDict ocmd)
Setting this property will attach the Annotation to an OptionalContentMembershipDict; it will then be associated with the OptionalContentGroups and be subject to the VisibilityPolicy and VisibilityExpression of that MembershipDict.
By setting this property to null, the Annotation is detached from any OptionalContentMembershipDict.
ocmd - the OptionalContentMembershipDictpublic boolean hasRichTextData()