Package com.evopdf
Class FileAttachmentElement
java.lang.Object
com.evopdf.PageElement
com.evopdf.FileAttachmentElement
This class represents a file attachment in the PDF document
-
Constructor Summary
ConstructorsConstructorDescriptionFileAttachmentElement
(RectangleFloat linkRectangle, byte[] fileData, String attachmentName) Creates a file attachment from a stream and a link in page to the attachmentFileAttachmentElement
(RectangleFloat linkRectangle, String filePath) Creates a file attachment and a link in page to the attachment -
Method Summary
Modifier and TypeMethodDescriptionGets the file attachment icon coloriconType()
Gets the file attachment icon typeGets the file attachment icon rectangle in PDF pagevoid
setIconColor
(RgbColor iconColor) Sets the file attachment icon color.void
setIconType
(FileAttachmentIcon iconType) Sets the file attachment icon type.void
setLinkRectangle
(RectangleFloat linkRectangle) Sets the file attachment icon rectangle in PDF pagevoid
Sets the file attachment texttext()
Gets the file attachment text
-
Constructor Details
-
FileAttachmentElement
Creates a file attachment and a link in page to the attachment- Parameters:
linkRectangle
- The attachment link rectangle in pagefilePath
- The path to file to be attached- Throws:
Exception
- an exception is thrown if the file attachment element cannot be created
-
FileAttachmentElement
Creates a file attachment from a stream and a link in page to the attachment- Parameters:
linkRectangle
- the attachment link rectangle in pagefileData
- the file dataattachmentName
- a name for attachment
-
-
Method Details
-
iconType
Gets the file attachment icon type- Returns:
- the file attachment icon type
-
setIconType
Sets the file attachment icon type. The default icon is paper clip- Parameters:
iconType
- the file attachment icon type to set
-
iconColor
Gets the file attachment icon color- Returns:
- the file attachment icon color
-
setIconColor
Sets the file attachment icon color. By default is black- Parameters:
iconColor
- the file attachment icon color
-
text
Gets the file attachment text- Returns:
- the file attachment text
-
setText
Sets the file attachment text- Parameters:
text
- the file attachment text
-
linkRectangle
Gets the file attachment icon rectangle in PDF page- Returns:
- the file attachment icon rectangle in PDF page
-
setLinkRectangle
Sets the file attachment icon rectangle in PDF page- Parameters:
linkRectangle
- the file attachment icon rectangle to set in PDF page
-