public final class AnnotationFile extends PDFAnnotation
A subtype new PDFAnnotation
that allows files to be attached to the PDF.
File attachments do not work in the free Acrobat Reader - they require the full
version of Acrobat. Currently the "encrypt separately" option added in Acrobat 7
is not supported, although if the document is encrypted the attachment will be
encrypted with it.
Note in revisions prior to 2.6 this class dealt with the file internally. In 2.6
the EmbeddedFile handling was moved to a separate class, EmbeddedFile
,
which now handles all the details of the actual file.
Constructor and Description |
---|
AnnotationFile()
Create a new File annotation.
|
Modifier and Type | Method and Description |
---|---|
EmbeddedFile |
getFile()
Return the file embedded in this annotation
|
void |
rebuild()
Rebuild the annotation's appearance.
|
void |
setFile(EmbeddedFile file)
Set the contents of this annotation to the specified embedded file.
|
void |
setRectangle(float x1,
float y1,
float x2,
float y2)
Set the Rectangle for this annotation.
|
void |
setType(String type,
Color color)
Set the type of attachment - the physical appearance on the page.
|
String |
toString() |
addPropertyChangeListener, addReview, flatten, getAuthor, getColor, getContents, getCreationDate, getInReplyTo, getMetaData, getModifyDate, getOpacity, getPage, getPopup, getRectangle, getReplies, getReviews, getSubject, getType, getUniqueID, hasAppearanceState, isContentLocked, isPositionLocked, isPrintable, isReadOnly, isVisible, removePropertyChangeListener, setAuthor, setColor, setContents, setCreationDate, setInReplyTo, setLocked, setMetaData, setModifyDate, setOpacity, setPage, setPrintable, setReadOnly, setSubject, setUniqueID, setVisible
public AnnotationFile()
setFile()
method must be called.public void setType(String type, Color color)
IllegalArgumentException
will be thrown.type
- the type of attachment - one of the four values listed above.color
- the color of the attachmentpublic void setRectangle(float x1, float y1, float x2, float y2)
AnnotationFile
object,
only the first two co-ordinates are used - x2 and y2 are derived from x1 and
y1 and the size of the annotation.setRectangle
in class PDFAnnotation
x1
- the X co-ordinate of the bottom-left corner of the rectangley1
- the Y co-ordinate of the bottom-left corner of the rectanglex2
- the X co-ordinate of the top-right corner of the rectangley2
- the Y co-ordinate of the top-right corner of the rectanglepublic void setFile(EmbeddedFile file)
file
- the EmbeddedFile object to attachpublic EmbeddedFile getFile()
public void rebuild()
PDFAnnotation
PropertyChangeEvent
) is run on a specific thread.rebuild
in class PDFAnnotation
public String toString()
Copyright © 2001-2017 Big Faceless Organization