Hi Support,
I am unable to add the attached file as document attachment using Aspose.PDF version 20.7.
My add attachment code snippet is following:
using (Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(new
MemoryStream(_documentBytes, true)))
using (MemoryStream msDoc = new MemoryStream(fileAttachement.Bytes))
using (Aspose.Pdf.FileSpecification fileSpecification = new
Aspose.Pdf.FileSpecification(msDoc, fileAttachement.Name))
{
pdfDocument.EmbeddedFiles.Add(fileSpecification);
using (MemoryStream msOutput = new MemoryStream())
{
pdfDocument.Save(msOutput);
fileAttachement.DocBytes = msOutput.ToArray();
_documentBytes = fileAttachement.DocBytes;
}
}
File to add as attachment.zip (4.0 KB)
Regards