/**
* Use this method to add a file attachment at the document level.
* @param description the file description
* @param fileStore an array with the file. If it's <CODE>null</CODE>
* the file will be read from the disk
* @param file the path to the file. It will only be used if
* <CODE>fileStore</CODE> is not <CODE>null</CODE>
* @param fileDisplay the actual file name stored in the pdf
* @param mimeType mime type of the file
* @param afRelationshipValue AFRelationship key value, @see AFRelationshipValue. If <CODE>null</CODE>, @see AFRelationshipValue.Unspecified will be added.
*
* @throws IOException on error
*/
public void AddFileAttachment(String description, byte[] fileStore, String file, String fileDisplay,
String mimeType, PdfName afRelationshipValue)
{
PdfFileSpecification pdfFileSpecification = PdfFileSpecification.FileEmbedded(this, file, fileDisplay,
fileStore, mimeType, null, PdfStream.BEST_COMPRESSION);
if (afRelationshipValue != null)
{
pdfFileSpecification.Put(PdfName.AFRELATIONSHIP, afRelationshipValue);
}
else
{
pdfFileSpecification.Put(PdfName.AFRELATIONSHIP, AFRelationshipValue.Unspecified);
}
AddFileAttachment(description, pdfFileSpecification);
}