We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

File Attachments and Security


I am using ghe latest version of Aspose.PDF and seem to be getting a problem whereby attachments included in a PDF cannot be viewed when Security is applied to the created PDF.

I see that this was raised a while back and a hot fix issued, but the problem seems to have re-appeared.

Using the code below (from one of the examples) including the RED line makes the attachment unreadable.

Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

sec1.Paragraphs.Add(new Aspose.Pdf.Generator.Text("hello world"));

FileStream fstream;
fstream = new FileStream(@"c:\testimages\Harris_side fence view pt.JPG", FileMode.Open);

Aspose.Pdf.Generator.DocumentAttachment DocStreamAttachment = new Aspose.Pdf.Generator.DocumentAttachment();
DocStreamAttachment.DocumentAttachmentStream = fstream;
DocStreamAttachment.DocumentAttachmentContentType = "jpeg";

pdf1.Security = new Aspose.Pdf.Generator.Security();



Hi Chris,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the sample code.

I am able to generate you mentioned issue after an initial test. The issue has been registered in our issue tracking system with issue id: PDFNEWNET-34157. You will be notified via this forum thread regarding any updates against your reported issue. Also, as mentioned in you post that the issue was fixed a previous version, please share the issue id / thread link which was fixed as that will help us in identifying the cause of the issue soon.

Sorry for the inconvenience,


is this problem already fixed? I have this problem too. I use Aspose.Pdf for .NET 7.5.0

Hi Matthias,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have requested the development team to share an ETA regarding the resolution of PDFNEWNET-34157. As soon as I get a feedback, I will update via this forum thread.

However, to make sure that you are not facing a different issue or the cause of the issue is different, I would request you to share the sample code and template file with us.

Thank You & Best Regards,

The issues you have found earlier (filed as PDFNEWNET-34157) have been fixed in Aspose.Pdf for .NET 10.7.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.