Class FileAttachment
- java.lang.Object
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeBase
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeObject
-
- com.pdf_tools.fourheights.pdftoolbox.pdf.annotations.Annotation
-
- com.pdf_tools.fourheights.pdftoolbox.pdf.annotations.MarkupAnnotation
-
- com.pdf_tools.fourheights.pdftoolbox.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 FileAttachment
create(Document targetDocument, Point topLeft, FileReference attachedFile, Paint paint)
Create a file attachment annotation.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)-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.pdf.annotations.MarkupAnnotation
getInfo, getLocked, getReplies
-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.pdf.annotations.Annotation
copy, getBoundingBox, getHidden, getId, getNoPrint, getNoRotate, getNoZoom
-
Methods inherited from class com.pdf_tools.fourheights.pdftoolbox.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 thetargetDocument
has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
is read-onlyjava.lang.IllegalArgumentException
- if the color space of thepaint
argument is not a device color spacejava.lang.IllegalArgumentException
- if thepaint
has a non-null
pdftoolbox.pdf.content.Paint.getTransparency
withpdftoolbox.pdf.content.Transparency.getBlendMode
other thanpdftoolbox.pdf.content.BlendMode.NORMAL
java.lang.IllegalArgumentException
- if thepaint
argument is not associated with thetargetDocument
java.lang.IllegalArgumentException
- if theattachedFile
argument is not associated with thetargetDocument
ExistsException
- if theattachedFile
argument is already used as a plain embedded file, an associated file, or in a file attachment.java.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- iftopLeft
isnull
java.lang.IllegalArgumentException
- ifattachedFile
isnull
java.lang.IllegalArgumentException
- ifpaint
isnull
-
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
-
-