These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to export XML as XFDF

prespares
Registered: Nov 6 2008
Posts: 47

Hello,

I am trying to export with the use of a button XML as XFDF so that I can run VB in Outlook to re-populate a pdf as a static version.

I have a folder level script written as such:

app.addMenuItem({cName:"ExportXFDF", cParent:"Help",

app.beginPriv();
function this.exportASXFDF(c/documents and settings/ADVO

Associate/Desktop);
app.endPriv();
}
);

And a button on my form with an click event : this.exportAsXFDF();

Can't get it to fired, was wondering where I went wrong.

Joe

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
LiveCycle Designer doesn't support the exportAsXFDF method.
But, you can export data using the method xfa.host.exportData()
Filetype is XML or XDP (XDP only available if form is signed).

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

prespares
Registered: Nov 6 2008
Posts: 47
Can you automate this through Acrobat 9.1?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Actually the "exportAsXFDF()" function is supported for Static LiveCycle forms because the Static Forms maintian the old AcroForm field structure.

And yes, saving the file as XFDF or XDP can be easily automated in Acrobat. The reason your menu item doesn't work is because its chuck full of errors. Here's a proper Folder Level Script for saving the XFDF.
// Define trustedfunction to be used by menu itemvar MyExport = app.trustedFunction(function(oDoc){app.beginPriv();this.exportASXFDF({cPath:"/c/documents and settings/ADVOAssociate/Desktop/MyForm.XFDF"});app.endPriv();}); app.addMenuItem({cName:"ExportXFDF", cParent:"Help",cExec:"MyExport()"});

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

prespares
Registered: Nov 6 2008
Posts: 47
I added this to the folder level script config.js and when I checked it in the Debugger I received the following error:

this.exportASXFDF is not a function
5:Menu:Exec

Joe
prespares
Registered: Nov 6 2008
Posts: 47
Ok, I think I answered my own question. My form is a dynamic XML form, so I am guessing the folder level script won't work for me and that I should stick with XML.

Is this correct?

If so, can I use xfa.host.importData() in a Batch process in acrobat 9.1?

Joe
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
There is a small typing error in the example.

Replace
this.exportASXFDF({cPath:".....XFDF"});
with
this.exportAsXFDF({cPath:"......XFDF"});
Attention: This method works for static and dynamic forms, but by using this method on dynamic forms the xfdf-file will not contain any data.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Thanks Radzmar, Yes a little typing error. References are wonderful things, but only of course if you look in them;)

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script