public class FileAttachment extends MarkupAnnotation
Modifier and Type | Method and Description |
---|---|
static FileAttachment |
create(Document targetDocument,
Point topLeft,
FileReference attachedFile,
Paint paint)
Create a file attachment annotation.
|
static FileAttachment |
createDynamicObject(long handle) |
FileReference |
getAttachedFile()
The embedded file (Getter)
|
FileAttachmentIcon |
getIcon()
The displayed icon (Getter)
|
Paint |
getPaint()
The paint for the icon and the popup (Getter)
|
Popup |
getPopup()
The pop-up (Getter)
|
getInfo, getLocked, getReplies
copy, getBoundingBox, getHidden, getNoPrint, getNoRotate, getNoZoom
equals, hashCode
public static FileAttachment createDynamicObject(long handle)
public static FileAttachment create(Document targetDocument, Point topLeft, FileReference attachedFile, Paint paint) throws ExistsException
targetDocument
- The output document with which the returned object is associatedtopLeft
- The location of the annotation's upper left corner on the page.attachedFile
- The file to be attached.paint
- This paint for the file attachment icon.java.lang.IllegalArgumentException
- if the targetDocument
is null
java.lang.IllegalArgumentException
- if the targetDocument
has already been closedjava.lang.IllegalArgumentException
- if the targetDocument
is read-onlyjava.lang.IllegalArgumentException
- if the paint
argument is null
java.lang.IllegalArgumentException
- if the color space of the paint
argument is not a device color spacejava.lang.IllegalArgumentException
- if the paint
has a non-null
pdftoolbox.pdf.content.Paint.getTransparency
with pdftoolbox.pdf.content.Transparency.getBlendMode
other than pdftoolbox.pdf.content.BlendMode.NORMAL
java.lang.IllegalArgumentException
- if the paint
argument is not associated with the targetDocument
java.lang.IllegalArgumentException
- if the attachedFile
argument is null
java.lang.IllegalArgumentException
- if the attachedFile
argument is not associated with the targetDocument
ExistsException
- if the attachedFile
argument is already used as a plain embedded file, an associated file, or in a file attachment.java.lang.IllegalArgumentException
- if topLeft
is null
public FileAttachmentIcon getIcon() throws CorruptException
java.lang.IllegalStateException
- if the object has already been closedCorruptException
- the document is corrupt and the file reference cannot be readpublic Paint getPaint() throws CorruptException
java.lang.IllegalStateException
- if the object has already been closedCorruptException
- if the PDF is corrupt and the annotation's paint cannot be readpublic FileReference getAttachedFile()
java.lang.IllegalStateException
- if the object has already been closedpublic Popup getPopup()
java.lang.IllegalStateException
- if the object has already been closed