Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Import/Export xml data from subtree of dynamic XFA form

Avatar

Level 2

Hi

We would like to import/export xml data (subtree) of a dynamic xfa form. The following script does only work with static AcroForms:

formular.content.subformDaten.Button1[1]::click - (JavaScript, client)

event.target.exportAsXFDF({aFields:["formular[0].content[0].subformDaten[0]"]});

With dynamic forms the script does export an empty xml file (no data is included, only xml root tag):

<?xml version="1.0" encoding="UTF-8"?>

<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"

><f href="ExportTest_frei.pdf"

/><ids original="EA43F92A6B6EA34F9C4DBBC2DA0B1840" modified="6A7C6282A167594F91240B773AA979A7"

/></xfdf

>

Any ideas? Many thanks.

Best regards,

Daniel

3 Replies

Avatar

Level 10

You shoudl not be using xfdf formats with an XFA form. You can use the command xfa.host.exportData("", false). This will bring up a dialog and allow the user to choose the file name of the xml file that they want. If you woudl rather stick with the command format that you have use the event.target.exportXFAData instead.

Paul

Avatar

Level 1

Hi Paul

The Problem that Daniel posted was originally mine. Now after subscribing to this forum myself, I try to describe the aim of using exportAsXFDF/importAnXFDF.

exportData("", false) and exportXFAData works, in my opinion, only with a DataConnection. In my form I have indeed such a connection for sending the whole form. But in addition I need the possibility to export and import only part of the data without overwriting the rest of the filled form.

exportAsXFDF works with static forms. So there MUST be a possibility that works with dynamic forms, right?

I hope anyone has a solution.

Beat

Avatar

Level 10

Nope ...XFDF should not be used with any  XFA form. It is not tested or verified hence it is not supported.

The exporting of data using import and exportXFAData does not rely on a DataConnection at all. It is used to interact with data files on the local machine.

You are correct that you cannot export only parts of the form ...it is all or nothing.

Paul