public interface FileAttachment extends Annotation
Modifier and Type | Field and Description |
---|---|
static String |
ICON_DEFAULT |
static String |
ICON_GRAPH |
static String |
ICON_PAPERCLIP |
static String |
ICON_PUSHPIN |
static String |
ICON_TAG |
BORDERSTYLE_BEVELED, BORDERSTYLE_CLOUD, BORDERSTYLE_DASHED, BORDERSTYLE_INSETS, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAGS_HIDDEN, FLAGS_INVISIBLE, FLAGS_LOCKED, FLAGS_LOCKEDCONTENTS, FLAGS_NOROTATE, FLAGS_NOVIEW, FLAGS_NOZOOM, FLAGS_PRINTABLE, FLAGS_READONLY
Modifier and Type | Method and Description |
---|---|
byte[] |
getCheckSum()
Returns the CRC checksum for the file contents.
|
Date |
getCreationDate()
Returns the date and time when the annotation was created.
|
byte[] |
getDeflatedContents()
Returns the file contents in deflated format
|
String |
getFileName()
Returns the name of the file.
|
int |
getFileSize()
Returns the length of the file, in bytes.
|
String |
getIconName()
Returns the name of the icon for this annotation.
|
InputStream |
getInputStream()
Returns the file contents as an input stream.
|
String |
getPopupText()
Returns the text that is displayed when the mouse hovers over the annotation.
|
void |
saveFile(File outFile)
Saves the content of the file to a file.
|
void |
setFileContents(byte[] fileContents)
Sets the file contents for the file attachment.
|
void |
setFileContents(File file)
Sets the file contents for the file attachment from a file.
|
void |
setFileContents(InputStream inStream)
Sets the file contents for this file attachment from an input stream.
|
void |
setFileName(String fileName)
Sets the name of the attached file.
|
void |
setIconName(String iconName)
Sets the icon name used when displaying this annotation.
|
void |
setPopupText(String popupText)
Sets the text that is displayed when the mouse hovers over the annotation.
|
void |
writeContents(OutputStream outStream)
Write the contents of the file attachment to an output stream
|
getActions, getAnnotationComponent, getBorderStyle, getBorderWidth, getCheckmarkStatus, getColor, getComponent, getContents, getCreator, getFlags, getIRTAnnotation, getModifiedDate, getName, getOpacity, getPageIndex, getRectangle, getReviewHistory, getSubject, getSubtype, getTriggerActions, isHidden, isInvisible, isIRTGroup, isLocked, isLockedContents, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, print, revalidate, setActions, setBorderStyle, setBorderWidth, setColor, setComponent, setComponentVisible, setCreator, setFlags, setHidden, setInvisible, setLayer, setLocked, setLockedContents, setModifiedDate, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPrintable, setReadOnly, setRectangle, setSubject, setTriggerActions, shiftRectangle
static final String ICON_GRAPH
static final String ICON_PAPERCLIP
static final String ICON_PUSHPIN
static final String ICON_TAG
static final String ICON_DEFAULT
String getIconName()
String getPopupText()
void setPopupText(String popupText)
popupText
- The new text string.void setIconName(String iconName)
iconName
- The name of the icon to use when displaying the annotation in its
un-opened mode. Please use one of the constants defined in this class (ICON_XXXX)
to set the name of the icon.void setFileContents(byte[] fileContents) throws PDFException, IOException
fileContents
- The new file contents.PDFException
- Thrown when there is an error modifying the PDF document.IOException
- Thrown if there is an error reading or writing the file contents.void setFileContents(File file) throws PDFException, IOException
file
- The file to read the contents from.PDFException
- Thrown when there is an error modifying the PDF document.IOException
- Thrown if there is an error reading the file contents.void setFileContents(InputStream inStream) throws PDFException, IOException
inStream
- The input stream to read the new file contents from.PDFException
- Thrown when there is an error modifying the PDF document.IOException
- Thrown if there is an error reading from the input stream.String getFileName()
void setFileName(String fileName)
fileName
- The name of the file.int getFileSize() throws IOException, PDFException
PDFException
- Thrown when there is an error reading the PDF document.IOException
- Thrown if there is an error reading the file size.byte[] getDeflatedContents() throws IOException, PDFException
PDFException
- Thrown when there is an error reading the PDF document.IOException
- Thrown if there is an error reading the file contents or deflating them.InputStream getInputStream() throws IOException, PDFException
PDFException
- Thrown when there is an error reading the PDF document.IOException
- Thrown if there is an error creating the input stream.byte[] getCheckSum() throws PDFException, IOException
PDFException
IOException
void writeContents(OutputStream outStream) throws IOException
outStream
- An OutputStream to write the contents to.IOException
- For any errors writing to the contents to the output stream.void saveFile(File outFile) throws IOException, PDFException
outFile
- the file to save to.IOException
- For any errors writing to the contents to the file.PDFException
- For any errors reading the contents of the annotation.Date getCreationDate()