Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Extracting XML from Dynamic Form

Avatar

Level 3

I noticed if you place an email button on the form, and click the submit it that will extract the XML into an attachement to the email.  Is their any way to have the xml generate without producing an email?  I need to be able to prompt the user to save it in a specific location.

Thanks in advance.

15 Replies

Avatar

Former Community Member

Put a button on your form and on the click event put this javascript code:

xfa.host.exportData("", false)

When the button is clicked a file dialog will appear and allow your user to choose a location and set a data filename. It will save with an xml extension.

Paul

Avatar

Level 3

That does not work... I put the button the form and placed the code as stated....

  Do you have to have Adobe Server to make that work?  This specific form will need to perform this

function with no connectivity what so ever.

Avatar

Former Community Member

That command does not rely on a server (the host ioin the expression refers to the application hosting the PDF). I gave you

the wrong syntax (I got my import and export mixed up ---- sorry) the command shoudl be:

xfa.host.exportData()

Paul

Avatar

Level 3

The command is still not executing.  I believe that has something to do with this statement concerning security  "Exports the data from the current form to a specified file in either XDP format or as plain XML data. For security purposes, this method only executes when performed on certified documents."

How is the document ceritified?

Avatar

Former Community Member

If you do not pass a parameter then the security does not kick in. Are you using Reader or Acrobat? If Reader you will have to Reader extend the file to allow for the local save.

Paul

Avatar

Level 3

It works in Pro, but it does not work in reader even though I extended the reader capability.  I have an example if you want to look at it.......  I have to have it work in reader for it to provided any value.

Thanks for your assistance.

Avatar

Former Community Member

Are you using version X or some other version? Looking at it won't do any good .....there are no moving parts to this. I want to try it in the same version as you.

Paul

Avatar

Former Community Member

Just tried it here and duplicated your issue. Looks like there is an issue with the Reader Extensions in Acrobat X. Can you report an issue to support?

Paul

Avatar

Former Community Member

Because your document contains script, the new Reader X will see it as a potenial security risk and therefore will not open it.

Adobe Reader X  includes a Protected Mode to prevent attacks through PDF files.  Protected Mode is a new security feature that protects users’ applications and data by limiting what malicious files can do and access.  Protected Mode is enabled by default and Adobe recommends that you leave it on for security reasons.

The extra security is great, if you don’t have to work with any dynamic PDF’s that have script embedded in it.

Disable protected mode manually by choosing Edit à Preferences à General tab and deselecting Enable Protected Mode on startup.

Let me know if this solves the problem.

Eve

Avatar

Level 3

The enable protected mode at startup is not checked, and I still have the problem.

Next suggestion?

Avatar

Level 3

Hi:  I did report this as a bug, I have not received any feedback...  So who

knows when they will address the issue.

Avatar

Level 3

I got this to work (1 year later) however it still brings up an email as well.  Any way to prevent this??