|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.qoppa.pdf.annotations.Annotation
com.qoppa.pdf.annotations.FileAttachment
Class representing a File Attachment annotation in a PDF document.
| Nested Class Summary | |
static interface |
FileAttachment.FileContentProvider
Interface used to provide data to the FileAttachment class. |
| Field Summary | |
static String |
ICON_DEFAULT
|
static String |
ICON_GRAPH
|
static String |
ICON_PAPERCLIP
|
static String |
ICON_PUSHPIN
|
static String |
ICON_TAG
|
| Fields inherited from class com.qoppa.pdf.annotations.Annotation |
BORDERSTYLE_BEVELED, BORDERSTYLE_DASHED, BORDERSTYLE_INSETS, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAGS_HIDDEN, FLAGS_INVISIBLE, FLAGS_LOCKED, FLAGS_NOROTATE, FLAGS_NOVIEW, FLAGS_NOZOOM, FLAGS_PRINTABLE, FLAGS_READONLY |
| Constructor Summary | |
FileAttachment(byte[] fileContents,
String fileName,
String popupText)
Constructs a file attachment annotation. |
|
FileAttachment(FileAttachment.FileContentProvider contents,
String fileName,
String popupText)
Constructor used when the file contents may not be so easily accessible as a byte array or file. |
|
FileAttachment(File attachFile,
String popupText)
Convenience constructor to create a file attachment from a file system file. |
|
| Method Summary | |
JComponent |
createComponent(Point2D cropOrigin,
IPDFActionHandler actionHandler)
Creates a JComponent object capable of displaying this annotation. |
byte[] |
getCheckSum()
Returns the CRC checksum for the file contents. |
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. |
String |
getSubtype()
Returns this annotation's subtype: "File-Attachment" |
boolean |
isPrintable()
Sound icon never prints. |
void |
paintImpl(Graphics g,
boolean hasFocus)
Draws the text icon. |
void |
revalidate()
Revalidates this annotation. |
void |
setFileContents(byte[] fileContents)
Sets the file contents for the file attachment. |
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. |
| Methods inherited from class com.qoppa.pdf.annotations.Annotation |
getActions, getAppearStream, getBorderStyle, getBorderWidth, getColor, getComponent, getContents, getCreationDate, getCreator, getFlags, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isReadOnly, paint, paintAppearStream, print, setActions, setAppearStream, setBorderStyle, setBorderWidth, setColor, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setPrintable, setReadOnly, setRectangle, setTriggerActions, shiftRectangle |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String ICON_GRAPH
public static final String ICON_PAPERCLIP
public static final String ICON_PUSHPIN
public static final String ICON_TAG
public static final String ICON_DEFAULT
| Constructor Detail |
public FileAttachment(byte[] fileContents,
String fileName,
String popupText)
throws IOException
fileContents - The binary contents of the file.fileName - The name of the file.popupText - The popup text to display when the mouse hovers over the annotation.
public FileAttachment(File attachFile,
String popupText)
throws IOException
attachFile - The file to attach. The constructor reads the contents of the file into memory.popupText - The popup text to display when the mouse hovers over the annotation.
IOException
public FileAttachment(FileAttachment.FileContentProvider contents,
String fileName,
String popupText)
contents - An object that fulfills the FileContentProvider interface.fileName - The name of the file to use in the PDF document.popupText - The popup text to display when the mouse hovers over the annotation.
IOException| Method Detail |
public String getSubtype()
getSubtype in class Annotation
public JComponent createComponent(Point2D cropOrigin,
IPDFActionHandler actionHandler)
createComponent in class Annotation
public void paintImpl(Graphics g,
boolean hasFocus)
g - The graphics object to use when drawing.public void revalidate()
Annotation
revalidate in class Annotationpublic boolean isPrintable()
isPrintable in class Annotationpublic String getIconName()
public String getPopupText()
public void setPopupText(String popupText)
popupText - The new text string.public 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.
public void setFileContents(byte[] fileContents)
throws IOException
fileContents - The new file contents.
IOExceptionpublic String getFileName()
public void setFileName(String fileName)
fileName - The name of the file.
public int getFileSize()
throws IOException,
PDFException
IOException
PDFException
public byte[] getDeflatedContents()
throws IOException,
PDFException
IOException
PDFException
public InputStream getInputStream()
throws IOException,
PDFException
IOException
PDFException
public byte[] getCheckSum()
throws PDFException,
IOException
PDFException
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||