Free Support Forum - aspose.com

XmlException when import Dynamic Stamp annotation using ImportAnnotationFromXfdf

Dear Aspose,


As my previous request to implement the stamp annotation in this link
http://www.aspose.com/community/forums/thread/397342.aspx has been implemented,

Now it has another problem when I try to use a custom dynamic stamp in the file attached.
Just for your input for further investigation, I think the problem is in the size limit of XML data in Aspose.PDF to handle the stamp annotation (or maybe for other types too).

The size of the stamped PDF file is < 600kb, but after the stamp is extracted in an xfdf format, the size of xfdf file becomes almost 4mb.

And the XmlException says:
"Invalid syntax for a decimal numeric entity reference. Line 23549, position 1632."

Here is the code sample:

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/AnnotFileDStamp.xfdf”), FileMode.OpenOrCreate);

PdfAnnotationEditor AnnEdit = new PdfAnnotationEditor();
AnnEdit.BindPdf(Server.MapPath(“TempFolder/A8000-999-PM-PRC-0013_C_Stamp.pdf”));
AnnEdit.ExportAnnotationsXfdf(fs1, 1, 1, annoType);

fs1.Close();

PdfAnnotationEditor AnnEdit2 = new PdfAnnotationEditor();
AnnEdit2.BindPdf(Server.MapPath(“TempFolder/A8000-999-PM-PRC-0013_C.pdf”));
AnnEdit2.ImportAnnotationFromXfdf(Server.MapPath(“TempFolder/AnnotFileDStamp.xfdf”), annoType);

AnnEdit2.Save(Server.MapPath(“TempFolder/A8000-999-PM-PRC-0013_C_StampResult.pdf”));


Please kindly fix this issue.

And appreciate much for the help.

Regards,
Erwin

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

Thank you for the details

I am able to reproduce your mentioned issue after an initial test. Your issue has been reported in our issue tracking system with issue id: PDFNEWNET-34588. We will notify you via this forum thread regarding any updates.

Sorry for the inconvenience,