Unknown XFDF element 'underline'

Hello :slight_smile:

I’m trying to merge a xfdf and pdf. I used the code from the example, this one:

PdfAnnotationEditor AnnotationEditor = new PdfAnnotationEditor();
AnnotationEditor.BindPdf(“emptyPdf.pdf”);
FileStream fileStream = new System.IO.FileStream(“annot.xfdf”, System.IO.FileMode.Open, System.IO.FileAccess.Read);
AnnotationEditor.ImportAnnotationFromXfdf(fileStream);
AnnotationEditor.Save(“annotedPdf.pdf”);

In the xfdf under I have elements for underline, strikeout, text and highlight.
I have only problem with the underline element. Why is that? And how to avoid this problem?
The error is telling that ‘underline’ is unknown element… :confused:

Hi Alek,


Thanks for contacting support.

Can you please share the resource file, so that we can test the scenario in our environment. We are sorry for this inconvenience.

Hi Nayyer,

I’m sending the resource file in the zip.
There you’ll find the xfdf, the source pdf, an example pdf how it should look and an example pdf what I get if I delete the underline elemenet (it works perfectly good for the others elements)… :slight_smile:

Hi Alek,

Thanks for sharing source documents. I have tested the scenario with shared documents using Aspose.Pdf for .NET 11.8.0 and managed to observe the reported exception. For further investigation, I have logged an issue in our issue tracking system as PDFNET-41209 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

Hi again from me :slight_smile:

I’m sending you a new xfdf file, tested on the same pdf, with probably almost every annotation.


I have the same problem - ‘Unknown XFDF element’, for this elements too: stamp, text, freetext, ink, line, circle, polyline, polygon.

I don’t know what’s the problem… Maybe I’m doing something wrong :frowning:

Hi Alek,


We are sorry for the inconvenience. I have tested the new XFDF file and noticed the reported exception, so logged another issue PDFNET-41211 and grouped together with above logged issue. We will keep you updated about the issue resolution progress of these issues.

Best Regards

Hi,

I post a message on this topic because I have the same error :

Message : Unknown XFDF element ‘square’

So I want to know if the issue is resolved? If yes where I can find the solution?

Best Regards

Richard

Hi There,


Thanks for your inquiry.

Please note that sometimes issues may be related with the specific input file and have been resolved for that particular file so we will really appreciate if you provide us a sample input document with which you are facing the issue. This way we can also observe the scenario in our environment and address it accordingly.

As far as above logged issues are concerned, I am afraid that they have not been resolved yet. Development team has been busy in fixing other reported issues in the queue prior to these. We are sure that they will soon plan to fix this as per their development schedule. We really appreciate your patience and cooperation in this regard. Please spare us little time.

We are sorry for the inconvenience.


Best Regards,

Hi,

We understand that this issue isn't the first in the priority queue but we buy the Aspose library to export comments as xfdf and import them from this export to an other document.

We have choose Aspose because many advisors says that it's one of the best library to do this and we are really disapointed of encountered issues.

We encounter 3 errors and we have investigate on theses issues by our own means. So can you please analyse the following screenshots in the attachment.

  • XML structure error (freetext html like embedded text)
  • Unkown XFDF Element ‘freetext’ : Xml parsing error: not well-formed (invalid token) And Unkown XFDF Element ‘square: Xml parsing error: not well-formed (invalid token)
We are waiting about your returns.

Regards

Hello Richard,


Thanks for writing back.

Please note that we do realize the criticality of the issue and for that we already have intimated the product team about your concerns. Every issue has equal importance for us and we make sure that they are resolved as soon as possible. Although issues have been resolved on first come first server basis, which we believe, is the fairest policy to everyone.

Concerning to your issue, we have provided the details which you have shared, to the relevant team and also intimated them about your recent concerns. As we requested earlier, that it would be helpful for us to investigate the issue, if you share an input document. We will really appreciate if you share your sample input file, so that we can observe issue in our environment and address it accordingly.

We are sorry for the inconvenience.


Best Regards,

Hello,
we have the same problem with many documents produced. Do you have any ETA of bugfix release? Are you aware of any workaround?

Thanks a lot

@MarioDattoli

Thanks for your inquiry.

I regret to share that due to low priority, earlier logged issues could not be resolved. However, we have escalated them to next priority level and as soon as we have some definite updates regarding resolution progress, we will let you know. Please be patient and spare us little time.

We are sorry for the inconvenience.

We have the same problems solvable with transformion of the xfdf xml with xslt.

An exception is thrown if Tag are selfclosing <tag …/>.
<square style="solid" width="1" color="#FF0000" opacity="1" creationdate="D:20190123132752Z" flags="print" date="D:20190123132752Z" page="0" rect="26.2442,372.744,562.756,464.412" title="" />

With these xml <tag … > it’s okay. The exception always include the next xml-tag.
<square style="solid" width="1" color="#FF0000" opacity="1" creationdate="D:20190123132752Z" flags="print" date="D:20190123132752Z" page="0" rect="26.2442,372.744,562.756,464.412" title="" /></square>

Second there are one special tag generated by the xfdf producer.
<freetext TextColor="#FF0000" style="solid" width="0" opacity="1" creationdate="D:20190123135009Z" flags="print" date="D:20190123135009Z" page="0" rect="150.687,107.75,233.703,153.55" title=""> <defaultstyle>font: Helvetica 16pt;color: #FF0000</defaultstyle> <defaultappearance> 1 0 0 RG 0 0 1 rg /Helv 16 Tf </defaultappearance> <contents>hummel</contents> <apref y="153.55" x="150.687" gennum="0" objnum="261" ></apref> </freetext>

Also it claims about completly unknown xml-tag like ‘apref’
class com.aspose.pdf.internal.ms.System.I0I: Unknown XFDF element 'apref' com.aspose.pdf.XfdfReader.lif(Unknown Source) com.aspose.pdf.FreeTextAnnotation.lif(Unknown Source)

Our xslt transformation now exclude this tags. But it would be better ist the transformation would not be needed and the XML-Parser could be a bit more friendly, like omiting unknown fields.

Thanks

@b.schalitz

Thanks for sharing the information.

It is good to know that you were able to resolve your issue using the workaround you have shared. We have logged shared details along with the logged ticket which will definitely help us during investigation process. As soon as the issue is resolved, we will surely let you know. Please spare us little time.

The issues you have found earlier (filed as PDFNET-41209) have been fixed in Aspose.PDF for .NET 22.1.