Constructor and Description |
---|
PdfFileAttachment(String filePath)
Constructs an attachment with specified file.
|
PdfFileAttachment(String filePath,
boolean compressAttachmentStream) |
PdfFileAttachment(String attachmentName,
byte[] bs)
Constructs an attachment with specified byte array.
|
PdfFileAttachment(String attachmentName,
byte[] bs,
boolean compressAttachmentStream) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
byte[] |
getByteStream()
Returns a byte array containing the attachment file.
|
String |
getFileAttachmentName()
Returns name of the attachment in the document.
|
void |
setByteStream(byte[] bs)
Specifies a byte array from which the attachment file needs to
be created.
|
void |
setFileAttachmentName(String name)
Specifies name of the attachment in the document.
|
void |
write(PdfDocument doc) |
public PdfFileAttachment(String filePath) throws IOException, PdfException
filePath
- pathname of the fileIOException
- if an I/O error occurs.PdfException
- if an illegal argument is supplied.public PdfFileAttachment(String filePath, boolean compressAttachmentStream) throws IOException, PdfException
IOException
PdfException
public PdfFileAttachment(String attachmentName, byte[] bs) throws IOException, PdfException
attachmentName
- name that needs to be used for the attachment in the
documentbs
- byte array containing the attachment fileIOException
- if an I/O error occurs.PdfException
- if an illegal argument is supplied.public PdfFileAttachment(String attachmentName, byte[] bs, boolean compressAttachmentStream) throws IOException, PdfException
IOException
PdfException
public void setByteStream(byte[] bs)
bs
- byte array containing the file used for the
attachmentpublic byte[] getByteStream()
public void setFileAttachmentName(String name)
name
- name of the attachment in the documentpublic String getFileAttachmentName()
public void write(PdfDocument doc) throws IOException
IOException