Class PDAnnotationFileAttachment
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotation
-
- com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
-
- com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotationFileAttachment
-
- All Implemented Interfaces:
COSObjectable
public class PDAnnotationFileAttachment extends PDAnnotationMarkup
This is the class that represents a file attachement.
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTACHMENT_NAME_GRAPHSee get/setAttachmentName.static StringATTACHMENT_NAME_PAPERCLIPSee get/setAttachmentName.static StringATTACHMENT_NAME_PUSH_PINSee get/setAttachmentName.static StringATTACHMENT_NAME_TAGSee get/setAttachmentName.static StringSUB_TYPEThe type of annotation.-
Fields inherited from class com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
RT_GROUP, RT_REPLY, SUB_TYPE_CARET, SUB_TYPE_FREETEXT, SUB_TYPE_INK, SUB_TYPE_POLYGON, SUB_TYPE_POLYLINE, SUB_TYPE_SOUND
-
-
Constructor Summary
Constructors Constructor Description PDAnnotationFileAttachment()Constructor.PDAnnotationFileAttachment(COSDictionary field)Creates a Link annotation from a COSDictionary, expected to be a correct object definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAttachmentName()This is the name used to draw the type of attachment.PDFileSpecificationgetFile()Return the attached file.voidsetAttachementName(String name)Set the name used to draw the attachement icon.voidsetFile(PDFileSpecification file)Set the attached file.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotation
createAnnotation, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getColor, getColor, getContents, getCOSObject, getModifiedDate, getNormalAppearanceStream, getPage, getRectangle, getStructParent, getSubtype, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceState, setColor, setContents, setHidden, setInvisible, setLocked, setModifiedDate, setNoRotate, setNoView, setNoZoom, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setToggleNoView
-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
getConstantOpacity, getCreationDate, getExternalData, getInReplyTo, getIntent, getPopup, getReplyType, getRichContents, getSubject, getTitlePopup, setConstantOpacity, setCreationDate, setExternalData, setInReplyTo, setIntent, setPopup, setReplyType, setRichContents, setSubject, setTitlePopup
-
-
-
-
Field Detail
-
ATTACHMENT_NAME_PUSH_PIN
public static final String ATTACHMENT_NAME_PUSH_PIN
See get/setAttachmentName.- See Also:
- Constant Field Values
-
ATTACHMENT_NAME_GRAPH
public static final String ATTACHMENT_NAME_GRAPH
See get/setAttachmentName.- See Also:
- Constant Field Values
-
ATTACHMENT_NAME_PAPERCLIP
public static final String ATTACHMENT_NAME_PAPERCLIP
See get/setAttachmentName.- See Also:
- Constant Field Values
-
ATTACHMENT_NAME_TAG
public static final String ATTACHMENT_NAME_TAG
See get/setAttachmentName.- See Also:
- Constant Field Values
-
SUB_TYPE
public static final String SUB_TYPE
The type of annotation.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDAnnotationFileAttachment
public PDAnnotationFileAttachment()
Constructor.
-
PDAnnotationFileAttachment
public PDAnnotationFileAttachment(COSDictionary field)
Creates a Link annotation from a COSDictionary, expected to be a correct object definition.- Parameters:
field- the PDF objet to represent as a field.
-
-
Method Detail
-
getFile
public PDFileSpecification getFile() throws IOException
Return the attached file.- Returns:
- The attached file.
- Throws:
IOException- If there is an error creating the file spec.
-
setFile
public void setFile(PDFileSpecification file)
Set the attached file.- Parameters:
file- The file that is attached.
-
getAttachmentName
public String getAttachmentName()
This is the name used to draw the type of attachment. See the ATTACHMENT_NAME_XXX constants.- Returns:
- The name that describes the visual cue for the attachment.
-
setAttachementName
public void setAttachementName(String name)
Set the name used to draw the attachement icon. See the ATTACHMENT_NAME_XXX constants.- Parameters:
name- The name of the visual icon to draw.
-
-