Hi Support,
I am getting an issue regarding PDF file attachments using Aspose.PDF.Document version 17.9.
My scenario is I have signed the document and add an attachment in the signed version of PDF.
After adding attachment, my PDF signature gets corrupt.
Could you please guide me in this scenario.
Code snippet for adding attachment is as follows:
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;
}
}
Regards