Hello Aspose,
I’m using the following code to add three .txt file attachments to an existing PDF, I can only open the second attachment. Output PDF file is attached.
Regards, Paul
License license = new License();
license.SetLicense("Aspose.Pdf.lic");
license.Embedded = true;
const string filename = @"C:\Temp\EmbeddedAttachments\test.pdf";
using (Document document = new Document(new FileStream(filename,
FileMode.Open, FileAccess.ReadWrite)))
{
document.EmbeddedFiles.Add(new FileSpecification(@"C:\Temp\EmbeddedAttachments\Test1.txt", "Test1.txt"));
document.EmbeddedFiles.Add(new FileSpecification(@"C:\Temp\EmbeddedAttachments\Test2.txt", "Test2.txt"));
document.EmbeddedFiles.Add(new FileSpecification(@"C:\Temp\EmbeddedAttachments\Test3.txt", "Test3.txt"));
document.Save(Path.ChangeExtension(filename, ".output.pdf"));
}