Search code examples
javascriptpdfadobeacrobatpdf-form

Extract values of a PDF form to a XML file using JS actions in Adobe Acrobat


I'm trying to get values of some specific form fields and then generate a XML file based on that data using JS actions when a user clicks a button in Adobe Acrobat. It's possible to get those values but I'm not sure how to generate that xml and provide it to the user. I do check these documents but can't find anything related:

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/iosapi/files/Doc.js.html

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/iosapi/files/App.js.html

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/iosapi/files/Util.js.html

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/iosapi/files/Event.js.html

https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/iosapi/files/Field.js.html

Any help would be appreciated.


Solution

  • If it is "just an XML", you could export as XFDF, which is the XML representation of FDF, the Forms Data File.

    Otherwise, you could create a (hidden) multiline text field, and assemble the XML, which you can then export.