Class FileAttachment
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.annotations.Annotation
-
- com.pdftools.toolbox.pdf.annotations.MarkupAnnotation
-
- com.pdftools.toolbox.pdf.annotations.FileAttachment
-
public class FileAttachment extends MarkupAnnotation
A file attachment annotation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileAttachmentcreate(Document targetDocument, Point topLeft, FileReference attachedFile, Paint paint)Create a file attachment annotation.FileReferencegetAttachedFile()The embedded file (Getter)FileAttachmentIcongetIcon()The displayed icon (Getter)PaintgetPaint()The paint for the icon and the popup (Getter)PopupgetPopup()The pop-up (Getter)-
Methods inherited from class com.pdftools.toolbox.pdf.annotations.MarkupAnnotation
getInfo, getLocked, getReplies
-
Methods inherited from class com.pdftools.toolbox.pdf.annotations.Annotation
copy, getBoundingBox, getHidden, getId, getNoPrint, getNoRotate, getNoZoom
-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static FileAttachment create(Document targetDocument, Point topLeft, FileReference attachedFile, Paint paint) throws ExistsException
Create a file attachment annotation.
The returned file attachment annotation is not yet part of any page. It can be added to a page's list of annotations.- Parameters:
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.- Returns:
- The newly created file attachment annotation.
- Throws:
java.lang.IllegalArgumentException- if thetargetDocumenthas already been closedjava.lang.IllegalArgumentException- if thetargetDocumentis read-onlyjava.lang.IllegalArgumentException- if the color space of thepaintargument is not a device color spacejava.lang.IllegalArgumentException- if thepainthas a non-nulltoolbox.pdf.content.Paint.getTransparencywithtoolbox.pdf.content.Transparency.getBlendModeother thantoolbox.pdf.content.BlendMode.NORMALjava.lang.IllegalArgumentException- if thepaintargument is not associated with thetargetDocumentjava.lang.IllegalArgumentException- if theattachedFileargument is not associated with thetargetDocumentExistsException- if theattachedFileargument is already used as a plain embedded file, an associated file, or in a file attachment.java.lang.IllegalArgumentException- iftargetDocumentisnulljava.lang.IllegalArgumentException- iftopLeftisnulljava.lang.IllegalArgumentException- ifattachedFileisnulljava.lang.IllegalArgumentException- ifpaintisnull
-
getIcon
public FileAttachmentIcon getIcon() throws CorruptException
The displayed icon (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closedCorruptException- the document is corrupt and the file reference cannot be read
-
getPaint
public Paint getPaint() throws CorruptException
The paint for the icon and the popup (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closedCorruptException- if the PDF is corrupt and the annotation's paint cannot be read
-
getAttachedFile
public FileReference getAttachedFile()
The embedded file (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
getPopup
public Popup getPopup()
The pop-up (Getter)
- Throws:
java.lang.IllegalStateException- if the object has already been closed
-
-