How to extract xfdf without nested format

Product: PDFtron

Please give a brief summary of your issue:
→ We want to extract xfdf in specific format.

We want to extract sub fields like this : -
<field name="Text2.0.0.0.1">

With Pdftron we are getting in this format : -
<field name="Text2"><field name="0"><field name="1" /><field name="0"><field name="0"><field name="0" /><field name="1"><value>Loc</value>

→ We are replacing our previous library with PDFtron so we will have to extract xfdf data as above
→ We are using this func to extract:
let documentxfdf = document?.fdfExtract(e_ptboth).saveAsXFDFToString()
→ We want to have hierarchy field name like “Text2.0.0.0.1” instead in nested syntax

Here is PDF File for sample:
Nested.pdf (226.9 KB)

Is their any parameter to pass or different func to achieve this?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

The XFDF format definition is part of the PDF ISO format and this nested structure is because fields can form a tree structure and the periods are a delimiter for the field names. That is you cannot have a period in a field name itself, except to form these trees.

For instance the PDF you sent has the following two fields.
Check Box38.0.0.1.0
Check Box38.0.0.1.1

Which are siblings of each other and both are children of Check Box38.0.0.1

Since XFDF is XML you could parse/edit it using any XML tool you like, though it may no longer be valid XFDF if you edit it and may no longer work as expected with any PDF tools that you pass the modified XFDF too.

Why exactly is the nesting structure an issue?
What tool has this issue? Why is that tool important?