public abstract class PDAnnotation extends Object implements COSObjectable
Constructor and Description |
---|
PDAnnotation()
Constructor.
|
PDAnnotation(COSDictionary dict)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static PDAnnotation |
createAnnotation(COSBase base)
Create the correct annotation from the base COS object.
|
int |
getAnnotationFlags()
This will get the flags for this field.
|
String |
getAnnotationName()
This will get the name, a string intended to uniquely identify each annotation within a page.
|
PDAppearanceDictionary |
getAppearance()
This will get the appearance dictionary associated with this annotation.
|
COSName |
getAppearanceState()
Returns the annotations appearance state, which selects the applicable appearance stream from an appearance
subdictionary.
|
COSArray |
getBorder()
This will retrieve the border array.
|
PDColor |
getColor()
This will retrieve the color used in drawing various elements.
|
protected PDColor |
getColor(COSName itemName) |
String |
getContents()
Get the "contents" of the field.
|
COSDictionary |
getCOSObject()
Interface method for COSObjectable.
|
String |
getModifiedDate()
This will retrieve the date and time the annotation was modified.
|
PDAppearanceStream |
getNormalAppearanceStream()
Returns the appearance stream for this annotation, if any.
|
PDPage |
getPage()
This will retrieve the corresponding page of this annotation.
|
PDRectangle |
getRectangle()
The annotation rectangle, defining the location of the annotation on the page in default user space units.
|
int |
getStructParent()
This will get the key of this annotation in the structural parent tree.
|
String |
getSubtype()
This will retrieve the subtype of the annotation.
|
boolean |
isHidden()
Get the hidden flag.
|
boolean |
isInvisible()
Get the invisible flag.
|
boolean |
isLocked()
Get the locked flag.
|
boolean |
isNoRotate()
Get the noRotate flag.
|
boolean |
isNoView()
Get the noView flag.
|
boolean |
isNoZoom()
Get the noZoom flag.
|
boolean |
isPrinted()
Get the printed flag.
|
boolean |
isReadOnly()
Get the readOnly flag.
|
boolean |
isToggleNoView()
Get the toggleNoView flag.
|
void |
setAnnotationFlags(int flags)
This will set the flags for this field.
|
void |
setAnnotationName(String nm)
This will set the name, a string intended to uniquely identify each annotation within a page.
|
void |
setAppearance(PDAppearanceDictionary appearance)
This will set the appearance associated with this annotation.
|
void |
setAppearanceState(String as)
This will set the annotations appearance state name.
|
void |
setBorder(COSArray borderArray)
This will set the border array.
|
void |
setColor(PDColor c)
This will set the color used in drawing various elements.
|
void |
setContents(String value)
Set the "contents" of the field.
|
void |
setHidden(boolean hidden)
Set the hidden flag.
|
void |
setInvisible(boolean invisible)
Set the invisible flag.
|
void |
setLocked(boolean locked)
Set the locked flag.
|
void |
setModifiedDate(Calendar c)
This will set the date and time the annotation was modified.
|
void |
setModifiedDate(String m)
This will set the date and time the annotation was modified.
|
void |
setNoRotate(boolean noRotate)
Set the noRotate flag.
|
void |
setNoView(boolean noView)
Set the noView flag.
|
void |
setNoZoom(boolean noZoom)
Set the noZoom flag.
|
void |
setPage(PDPage page)
This will set the corresponding page for this annotation.
|
void |
setPrinted(boolean printed)
Set the printed flag.
|
void |
setReadOnly(boolean readOnly)
Set the readOnly flag.
|
void |
setRectangle(PDRectangle rectangle)
This will set the rectangle for this annotation.
|
void |
setStructParent(int structParent)
This will set the key for this annotation in the structural parent tree.
|
void |
setToggleNoView(boolean toggleNoView)
Set the toggleNoView flag.
|
public PDAnnotation()
public PDAnnotation(COSDictionary dict)
dict
- The annotations dictionary.public static PDAnnotation createAnnotation(COSBase base) throws IOException
base
- The COS object that is the annotation.IOException
- If the annotation type is unknown.public PDRectangle getRectangle()
public void setRectangle(PDRectangle rectangle)
rectangle
- The new rectangle values.public int getAnnotationFlags()
public void setAnnotationFlags(int flags)
flags
- The new flags.public COSDictionary getCOSObject()
getCOSObject
in interface COSObjectable
public COSName getAppearanceState()
public void setAppearanceState(String as)
as
- The name of the appearance stream.public PDAppearanceDictionary getAppearance()
public void setAppearance(PDAppearanceDictionary appearance)
appearance
- The appearance dictionary for this annotation.public PDAppearanceStream getNormalAppearanceStream()
public boolean isInvisible()
public void setInvisible(boolean invisible)
invisible
- The new invisible flag.public boolean isHidden()
public void setHidden(boolean hidden)
hidden
- The new hidden flag.public boolean isPrinted()
public void setPrinted(boolean printed)
printed
- The new printed flag.public boolean isNoZoom()
public void setNoZoom(boolean noZoom)
noZoom
- The new noZoom flag.public boolean isNoRotate()
public void setNoRotate(boolean noRotate)
noRotate
- The new noRotate flag.public boolean isNoView()
public void setNoView(boolean noView)
noView
- The new noView flag.public boolean isReadOnly()
public void setReadOnly(boolean readOnly)
readOnly
- The new readOnly flag.public boolean isLocked()
public void setLocked(boolean locked)
locked
- The new locked flag.public boolean isToggleNoView()
public void setToggleNoView(boolean toggleNoView)
toggleNoView
- The new toggleNoView flag.public String getContents()
public void setContents(String value)
value
- the value of the contents.public String getModifiedDate()
public void setModifiedDate(String m)
m
- the date and time the annotation was created. Date values used in a PDF shall
conform to a standard date format, which closely follows that of the international standard
ASN.1 (Abstract Syntax Notation One), defined in ISO/IEC 8824. A date shall be a text string
of the form (D:YYYYMMDDHHmmSSOHH'mm). Alternatively, use
setModifiedDate(java.util.Calendar)
public void setModifiedDate(Calendar c)
c
- the date and time the annotation was created.public String getAnnotationName()
public void setAnnotationName(String nm)
nm
- The identifying name for the annotation.public int getStructParent()
public void setStructParent(int structParent)
structParent
- The new key for this annotation.public COSArray getBorder()
public void setBorder(COSArray borderArray)
borderArray
- the border array to set.public void setColor(PDColor c)
c
- colour in the DeviceRGB colourspacepublic PDColor getColor()
public String getSubtype()
public void setPage(PDPage page)
page
- is the corresponding pagepublic PDPage getPage()
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.