Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfFileAttachment

java.lang.Object
  extended bycom.gnostice.pdfone.PdfFileAttachment
All Implemented Interfaces:
Cloneable

public final class PdfFileAttachment
extends Object
implements Cloneable

This class represents a file attachement that can be added to a PDF document.


Constructor Summary
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)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfFileAttachment

public PdfFileAttachment(String filePath)
                  throws IOException,
                         PdfException
Constructs an attachment with specified file.

Parameters:
filePath - pathname of the file
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

PdfFileAttachment

public PdfFileAttachment(String filePath,
                         boolean compressAttachmentStream)
                  throws IOException,
                         PdfException

PdfFileAttachment

public PdfFileAttachment(String attachmentName,
                         byte[] bs)
                  throws IOException,
                         PdfException
Constructs an attachment with specified byte array.

Parameters:
attachmentName - name that needs to be used for the attachment in the document
bs - byte array containing the attachment file
Throws:
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.

PdfFileAttachment

public PdfFileAttachment(String attachmentName,
                         byte[] bs,
                         boolean compressAttachmentStream)
                  throws IOException,
                         PdfException
Method Detail

clone

public Object clone()

setByteStream

public void setByteStream(byte[] bs)
Specifies a byte array from which the attachment file needs to be created.

Parameters:
bs - byte array containing the file used for the attachment

getByteStream

public byte[] getByteStream()
Returns a byte array containing the attachment file.

Returns:
a byte array containing the attachment file

setFileAttachmentName

public void setFileAttachmentName(String name)
Specifies name of the attachment in the document.

Parameters:
name - name of the attachment in the document

getFileAttachmentName

public String getFileAttachmentName()
Returns name of the attachment in the document.

Returns:
name of the attachment in the document

write

public void write(PdfDocument doc)
           throws IOException
Throws:
IOException

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com