Class PDAnnotationFileAttachment
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationFileAttachment
- All Implemented Interfaces:
COSObjectable
This is the class that represents a file attachment.
- Author:
- Ben Litchfield
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSee get/setAttachmentName.static final StringSee get/setAttachmentName.static final StringSee get/setAttachmentName.static final StringSee get/setAttachmentName.static final StringThe type of annotation.Fields inherited from class PDAnnotationMarkup
IT_FREE_TEXT, IT_FREE_TEXT_CALLOUT, IT_FREE_TEXT_TYPE_WRITER, RT_GROUP, RT_REPLY, SUB_TYPE_CARET, SUB_TYPE_FREETEXT, SUB_TYPE_INK, SUB_TYPE_POLYGON, SUB_TYPE_POLYLINE, SUB_TYPE_SOUND -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Creates a Link annotation from a COSDictionary, expected to be a correct object definition. -
Method Summary
Modifier and TypeMethodDescriptionThis is the name used to draw the type of attachment.getFile()Return the attached file.voidsetAttachementName(String name) Deprecated.voidsetAttachmentName(String name) Set the name used to draw the attachment icon.voidsetFile(PDFileSpecification file) Set the attached file.Methods inherited from class PDAnnotationMarkup
constructAppearances, constructAppearances, getBorderEffect, getBorderStyle, getCallout, getConstantOpacity, getCreationDate, getDefaultAppearance, getDefaultStyleString, getEndPointEndingStyle, getExternalData, getInkList, getInReplyTo, getIntent, getInteriorColor, getLineEndingStyle, getPath, getPopup, getQ, getRectDifference, getRectDifferences, getReplyType, getRichContents, getStartPointEndingStyle, getSubject, getTitlePopup, getVertices, setBorderEffect, setBorderStyle, setCallout, setConstantOpacity, setCreationDate, setCustomAppearanceHandler, setDefaultAppearance, setDefaultStyleString, setEndPointEndingStyle, setExternalData, setInkList, setInReplyTo, setIntent, setInteriorColor, setLineEndingStyle, setPopup, setQ, setRectDifference, setRectDifferences, setRectDifferences, setReplyType, setRichContents, setStartPointEndingStyle, setSubject, setTitlePopup, setVerticesMethods inherited from class PDAnnotation
createAnnotation, equals, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getBorder, getColor, getColor, getContents, getCOSObject, getModifiedDate, getNormalAppearanceStream, getOptionalContent, getPage, getRectangle, getStructParent, getSubtype, hashCode, isHidden, isInvisible, isLocked, isLockedContents, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceState, setBorder, setColor, setContents, setHidden, setInvisible, setLocked, setLockedContents, setModifiedDate, setModifiedDate, setNoRotate, setNoView, setNoZoom, setOptionalContent, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setToggleNoView
-
Field Details
-
ATTACHMENT_NAME_PUSH_PIN
-
ATTACHMENT_NAME_GRAPH
-
ATTACHMENT_NAME_PAPERCLIP
-
ATTACHMENT_NAME_TAG
-
SUB_TYPE
-
-
Constructor Details
-
PDAnnotationFileAttachment
public PDAnnotationFileAttachment()Constructor. -
PDAnnotationFileAttachment
Creates a Link annotation from a COSDictionary, expected to be a correct object definition.- Parameters:
field- the PDF object to represent as a field.
-
-
Method Details
-
getFile
Return the attached file.- Returns:
- The attached file.
- Throws:
IOException- If there is an error creating the file spec.
-
setFile
Set the attached file.- Parameters:
file- The file that is attached.
-
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
Deprecated.Set the name used to draw the attachment icon. See the ATTACHMENT_NAME_XXX constants.- Parameters:
name- The name of the visual icon to draw.
-
setAttachmentName
Set the name used to draw the attachment icon. See the ATTACHMENT_NAME_XXX constants.- Parameters:
name- The name of the visual icon to draw.
-
setAttachmentName(java.lang.String).