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

Free Support Forum - aspose.com

Attachment problem using ImportAnnotationFromXfdf method

Dear Aspose,


I have a problem with an attachment type of annotation/comment using ImportAnnotationFromXfdf method in PdfAnnotationEditor object. I’m using Aspose.PDF version 7.4.

Here I’ve made a code sample for your review

License vLicense = new License();
vLicense.SetLicense(“Aspose.Total.lic”);

Enum[] annoType = {
AnnotationType.Highlight,
AnnotationType.Underline,
AnnotationType.Caret,
AnnotationType.Circle,
AnnotationType.FileAttachment,
AnnotationType.FreeText,
AnnotationType.Ink,
AnnotationType.Line,
AnnotationType.Link,
AnnotationType.Movie,
AnnotationType.Polygon,
AnnotationType.PolyLine,
AnnotationType.PrinterMark,
AnnotationType.Screen,
AnnotationType.Sound,
AnnotationType.Square,
AnnotationType.Squiggly,
AnnotationType.Stamp,
AnnotationType.StrikeOut,
AnnotationType.Text,
AnnotationType.TrapNet,
AnnotationType.Watermark,
AnnotationType.Widget
};

FileStream fs1 = new FileStream(Server.MapPath(“TempFolder/AnnotFile2.xfdf”), FileMode.OpenOrCreate);

PdfAnnotationEditor AnnEdit = new PdfAnnotationEditor();
AnnEdit.BindPdf(Server.MapPath(“TempFolder/SourceWithAttachment.pdf”));
AnnEdit.ExportAnnotationsXfdf(fs1, 1, 1, annoType);

fs1.Close();

AnnEdit = new PdfAnnotationEditor();
AnnEdit.BindPdf(Server.MapPath(“TempFolder/Source.pdf”));
AnnEdit.ImportAnnotationFromXfdf(Server.MapPath(“TempFolder/AnnotFile2.xfdf”), annoType);

AnnEdit.Save(Server.MapPath(“TempFolder/SourceWithAttachment2.pdf”));

And I’m attaching the Source.pdf and SourceWithAttachment.pdf for your further handling.

When you run the code, the AnnotFile2.xfdf is perfectly created, and the attachment object is also created in SourceWithAttachment2.pdf, but you can’t open it with this error message:

"Adobe Reader could not open ‘filename.pdf’ because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn’t correctly decoded)."

I’ve made some investigations. Export the comments in the SourceWithAttachment2.pdf into an xfdf format (SourceWithAttachment2.xfdf), and compare it with the AnnotFile2.xfdf, then you will see that an attribute filter=“FlateDecode” is missing from tag. If you edit the SourceWithAttachment2.xfdf and put filter=“FlateDecode” in the tag, then open it, you will be able to open the attachment. It was missing during the execution of the ImportAnnotationFromXfdf method.

Please check and fix it as soon as possible.

Appreciate much for the help,

And thank you

Regards,
Erwin

Another symptom:

When you use the SourceWithAttachment2.pdf (result file from previous code) as the feed of comments, it will trigger an application exception:

"Required entry is absent in annotation dictionary"

Here is the code:

FileStream fs1 = new FileStream(Server.MapPath(“TempFolder/AnnotFile3.xfdf”), FileMode.OpenOrCreate);

PdfAnnotationEditor AnnEdit = new PdfAnnotationEditor();
AnnEdit.BindPdf(Server.MapPath(“TempFolder/SourceWithAttachment2.pdf”));
AnnEdit.ExportAnnotationsXfdf(fs1, 1, 1, annoType);
fs1.Close();

PdfAnnotationEditor AnnEdit2 = new PdfAnnotationEditor();
AnnEdit2.BindPdf(Server.MapPath(“TempFolder/Source.pdf”));
AnnEdit2.ImportAnnotationFromXfdf(Server.MapPath(“TempFolder/AnnotFile3.xfdf”), annoType);
AnnEdit2.Save(Server.MapPath(“TempFolder/SourceWithAttachment3.pdf”));


Please fix it ASAP since people are using it to review the live documents at the moment… please… please…

Thanks and regards,
Erwin

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

Thank you for sharing the files and sample code.

I am able to reproduce both of your reported issues. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34580 and PDFNEWNET-34581 respectively. We will notify you via this forum thread regarding any updates.

Regarding the request for a quick resolution, I am afraid, we cannot provide a fix on such a short notice. Our development team will need some time to analyze the issue and schedule it for fixing as per their schedule. Please be patient and spare us some time to further investigate the issue.

Sorry for the inconvenience,

Dear Aspose,


I haven’t heard any news for a while.
Any progress on the above matter?

Thanks and happy new year :slight_smile:

cheers,
erwin

Hi Erwin,


Thanks for your patience and greetings for the new year.

The development team has been busy resolving other priority issues and I am afraid the above stated problems are not yet resolved. Nevertheless, I have asked the development team to share some ETA. As soon as I have the required information, I would be more than happy to update you with the status of correction. Please be patient and spare us little time.

Your patience and comprehension is greatly appreciated in this regard. We are sorry for this delay and inconvenience.

Dear Aspose,


It’s been 2 months and I haven’t received any update so far.
Is there any good news in regards to this issue?

Appreciate if you can speed up to solve it.

Thank you

Regards,
Erwin

Hi Erwin,


Thanks for your patience.

Our development team is investigating these issues and I am afraid they are not yet resolved. Nevertheless, I have requested the team to share the ETA regarding its resolution. Please be patient and spare us little time. As soon as I have the required information, I would be more than happy to update you with the status of correction.

We are sorry for this delay and inconvenience.

PS, All the issues are resolved based on priority/schedule. Please note that the issues logged under Enterprise/Priority support model have high precedence in terms of resolution as compare to the issue logged under normal support. So issues with PS/ES support are first resolved.

Hi Erwin,


I have further discussed with development team and as per our current estimates, we plan to get the issues reported earlier in next release version i.e. Aspose.Pdf for .NET 7.8.0, but still its not a promise. We will try our level best to get these problems fixed by the said time.

My humble request is to please be patient and spare us little time.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

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

Blog post for this release can be viewed over this link


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

Hi Erwin,


Thanks for your patience.

We are pleased to share that the issue reported earlier as PDFNEWNET-34581 is resolved in latest release of Aspose.Pdf for .NET 9.4.0. Please note that Filter entry is absent in PDF document and attachment is inaccessible. If it does not throw exception, treat this as “FlateDecode” file and its exported successfully.