Package org.apache.pdfbox.pdmodel.fdf
Class FDFAnnotation
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.fdf.FDFAnnotation
-
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
FDFAnnotationCaret,FDFAnnotationCircle,FDFAnnotationFileAttachment,FDFAnnotationFreeText,FDFAnnotationHighlight,FDFAnnotationInk,FDFAnnotationLine,FDFAnnotationPolygon,FDFAnnotationPolyline,FDFAnnotationSound,FDFAnnotationSquare,FDFAnnotationSquiggly,FDFAnnotationStamp,FDFAnnotationStrikeOut,FDFAnnotationText,FDFAnnotationUnderline
public abstract class FDFAnnotation extends java.lang.Object implements COSObjectable
This represents an FDF annotation that is part of the FDF document.- Author:
- Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description protected COSDictionaryannotAnnotation dictionary.
-
Constructor Summary
Constructors Constructor Description FDFAnnotation()Default constructor.FDFAnnotation(COSDictionary a)Constructor.FDFAnnotation(org.w3c.dom.Element element)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FDFAnnotationcreate(COSDictionary fdfDic)Create the correct FDFAnnotation.java.awt.ColorgetColor()Get the annotation color.COSDictionarygetCOSDictionary()Convert this standard java object to a COS object.COSBasegetCOSObject()Convert this standard java object to a COS object.java.util.CalendargetCreationDate()The annotation create date.java.lang.StringgetDate()Modification date.java.lang.StringgetName()Get the annotation name.floatgetOpacity()Get the opacity value.java.lang.IntegergetPage()This will get the page number or null if it does not exist.PDRectanglegetRectangle()The rectangle associated with this annotation.java.lang.StringgetSubject()Get the description of the annotation.java.lang.StringgetTitle()Get the annotation title.booleanisHidden()Get the hidden flag.booleanisInvisible()Get the invisible flag.booleanisLocked()Get the locked flag.booleanisNoRotate()Get the noRotate flag.booleanisNoView()Get the noView flag.booleanisNoZoom()Get the noZoom flag.booleanisPrinted()Get the printed flag.booleanisReadOnly()Get the readOnly flag.booleanisToggleNoView()Get the toggleNoView flag.voidsetColor(java.awt.Color c)Set the annotation color.voidsetCreationDate(java.util.Calendar date)Set the creation date.voidsetDate(java.lang.String date)The annotation modification date.voidsetHidden(boolean hidden)Set the hidden flag.voidsetInvisible(boolean invisible)Set the invisible flag.voidsetLocked(boolean locked)Set the locked flag.voidsetName(java.lang.String name)Set a unique name for an annotation.voidsetNoRotate(boolean noRotate)Set the noRotate flag.voidsetNoView(boolean noView)Set the noView flag.voidsetNoZoom(boolean noZoom)Set the noZoom flag.voidsetOpacity(float opacity)Set the annotation opacity.voidsetPage(int page)This will set the page.voidsetPrinted(boolean printed)Set the printed flag.voidsetReadOnly(boolean readOnly)Set the readOnly flag.voidsetRectangle(PDRectangle rectangle)Set the rectangle associated with this annotation.voidsetSubject(java.lang.String subject)A short description of the annotation.voidsetTitle(java.lang.String title)Set a unique title for an annotation.voidsetToggleNoView(boolean toggleNoView)Set the toggleNoView flag.
-
-
-
Field Detail
-
annot
protected COSDictionary annot
Annotation dictionary.
-
-
Constructor Detail
-
FDFAnnotation
public FDFAnnotation()
Default constructor.
-
FDFAnnotation
public FDFAnnotation(COSDictionary a)
Constructor.- Parameters:
a- The FDF annotation.
-
FDFAnnotation
public FDFAnnotation(org.w3c.dom.Element element) throws java.io.IOExceptionConstructor.- Parameters:
element- An XFDF element.- Throws:
java.io.IOException- If there is an error extracting data from the element.
-
-
Method Detail
-
create
public static FDFAnnotation create(COSDictionary fdfDic) throws java.io.IOException
Create the correct FDFAnnotation.- Parameters:
fdfDic- The FDF dictionary.- Returns:
- A newly created FDFAnnotation
- Throws:
java.io.IOException- If there is an error accessing the FDF information.
-
getCOSObject
public COSBase getCOSObject()
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
getCOSDictionary
public COSDictionary getCOSDictionary()
Convert this standard java object to a COS object.- Returns:
- The cos object that matches this Java object.
-
getPage
public java.lang.Integer getPage()
This will get the page number or null if it does not exist.- Returns:
- The page number.
-
setPage
public void setPage(int page)
This will set the page.- Parameters:
page- The page number.
-
getColor
public java.awt.Color getColor()
Get the annotation color.- Returns:
- The annotation color, or null if there is none.
-
setColor
public void setColor(java.awt.Color c)
Set the annotation color.- Parameters:
c- The annotation color.
-
getDate
public java.lang.String getDate()
Modification date.- Returns:
- The date as a string.
-
setDate
public void setDate(java.lang.String date)
The annotation modification date.- Parameters:
date- The date to store in the FDF annotation.
-
isInvisible
public boolean isInvisible()
Get the invisible flag.- Returns:
- The invisible flag.
-
setInvisible
public void setInvisible(boolean invisible)
Set the invisible flag.- Parameters:
invisible- The new invisible flag.
-
isHidden
public boolean isHidden()
Get the hidden flag.- Returns:
- The hidden flag.
-
setHidden
public void setHidden(boolean hidden)
Set the hidden flag.- Parameters:
hidden- The new hidden flag.
-
isPrinted
public boolean isPrinted()
Get the printed flag.- Returns:
- The printed flag.
-
setPrinted
public void setPrinted(boolean printed)
Set the printed flag.- Parameters:
printed- The new printed flag.
-
isNoZoom
public boolean isNoZoom()
Get the noZoom flag.- Returns:
- The noZoom flag.
-
setNoZoom
public void setNoZoom(boolean noZoom)
Set the noZoom flag.- Parameters:
noZoom- The new noZoom flag.
-
isNoRotate
public boolean isNoRotate()
Get the noRotate flag.- Returns:
- The noRotate flag.
-
setNoRotate
public void setNoRotate(boolean noRotate)
Set the noRotate flag.- Parameters:
noRotate- The new noRotate flag.
-
isNoView
public boolean isNoView()
Get the noView flag.- Returns:
- The noView flag.
-
setNoView
public void setNoView(boolean noView)
Set the noView flag.- Parameters:
noView- The new noView flag.
-
isReadOnly
public boolean isReadOnly()
Get the readOnly flag.- Returns:
- The readOnly flag.
-
setReadOnly
public void setReadOnly(boolean readOnly)
Set the readOnly flag.- Parameters:
readOnly- The new readOnly flag.
-
isLocked
public boolean isLocked()
Get the locked flag.- Returns:
- The locked flag.
-
setLocked
public void setLocked(boolean locked)
Set the locked flag.- Parameters:
locked- The new locked flag.
-
isToggleNoView
public boolean isToggleNoView()
Get the toggleNoView flag.- Returns:
- The toggleNoView flag.
-
setToggleNoView
public void setToggleNoView(boolean toggleNoView)
Set the toggleNoView flag.- Parameters:
toggleNoView- The new toggleNoView flag.
-
setName
public void setName(java.lang.String name)
Set a unique name for an annotation.- Parameters:
name- The unique annotation name.
-
getName
public java.lang.String getName()
Get the annotation name.- Returns:
- The unique name of the annotation.
-
setRectangle
public void setRectangle(PDRectangle rectangle)
Set the rectangle associated with this annotation.- Parameters:
rectangle- The annotation rectangle.
-
getRectangle
public PDRectangle getRectangle()
The rectangle associated with this annotation.- Returns:
- The annotation rectangle.
-
setTitle
public void setTitle(java.lang.String title)
Set a unique title for an annotation.- Parameters:
title- The annotation title.
-
getTitle
public java.lang.String getTitle()
Get the annotation title.- Returns:
- The title of the annotation.
-
getCreationDate
public java.util.Calendar getCreationDate() throws java.io.IOExceptionThe annotation create date.- Returns:
- The date of the creation of the annotation date
- Throws:
java.io.IOException- If there is an error converting the string to a Calendar object.
-
setCreationDate
public void setCreationDate(java.util.Calendar date)
Set the creation date.- Parameters:
date- The date the annotation was created.
-
setOpacity
public void setOpacity(float opacity)
Set the annotation opacity.- Parameters:
opacity- The new opacity value.
-
getOpacity
public float getOpacity()
Get the opacity value.- Returns:
- The opacity of the annotation.
-
setSubject
public void setSubject(java.lang.String subject)
A short description of the annotation.- Parameters:
subject- The annotation subject.
-
getSubject
public java.lang.String getSubject()
Get the description of the annotation.- Returns:
- The subject of the annotation.
-
-