I am creating a document with file attachment.
Pdf pdf1 = new Pdf();
Section sec1 = pdf1.Sections.Add();
…
…
Attachment fileAttachment = new Attachment();
sec1.Paragraphs.Add(fileAttachment);
fileAttachment.AttachmentType = AttachmentType.File;
fileAttachment.AttachedFileName = myFileName;
fileAttachment.AttachedFileType = “tlc”;
fileAttachment.FileIconType = FileIconType.Tag;
fileAttachment.IconColor = new Aspose.Pdf.Color(“Red”);
pdf1.Save(pdfFileName);
This works fine, I can open my attachment in the resulting .pdf. However, when I add a Security object to this document (I do it right before I save it), I no longer can open my attachment, and the name of the file appears to be junk when I double-click on it. This is the code that I add before pdf1.Save line
Security secu = new Security();
secu.MasterPassword = “abc”;
secu.UserPassword = “def”;
pdf1.Security = secu;
Any help would be appreciated.
Dear igorb,
Thanks for your consideartion.
I will fix this bug soon.