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

Saving a form data file on the computer

tsierra
Registered: Jul 24 2009
Posts: 43
Answered

Hello,

I've created a form that can be later submitted by email. I would like to create an additional button with the option to save the form data file .fdf (not the entire pdf) onto the computer. The end user will be using Adobe Acrobat Reader 8 not Professional. Is this possible, if so how would I go about accomplishing such a task?

Thanks

My Product Information:
Acrobat Pro 8.1.7, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Unfortunately the real functionality for saving an FDF file does not match the documentation, which states that the "doc.exportAsFDF()" function will work in Reader if the form is enabled for Reader Form/Save Rights and no path is specified. So it should work but it doesn't, at least it doesn't work on the Windows Reader 8 version. It might work on the Mac Reader 8. I didn't test it on 9.

This is exactly the kind of functionality that tends to change between verions, even between subversions. I suggest you give it a try on the target platforms.

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

tsierra
Registered: Jul 24 2009
Posts: 43
Hello,

I'm a little confused. Are you saying that in theory I should be able to perform this function using the javascript you provided but may encounter some problems between versions?



So in theory all I need to do is create a button and add the following javascript line:
doc.exportAsFDF

should I include any parenthesis, quotes, etc.



My apologies again, I am new to scripting.


Thanks again
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yep, that's what I'm saying. Since the exportAsFDF function touches the outside world its in a grey security zone. What Acrobat does or doesn't alow for this kind of thing is subject to change between versions.

You must include the parenthesis sine this is a function. But you've got the right idea. Add a button with a MouseUp "Run a JavaScript" action. Then place this code in the button

this.exportAsFDF();

Take a look in the Acrobat JavaScript Reference.

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

tsierra
Registered: Jul 24 2009
Posts: 43
Should this work for those using Adobe Reader 8 and higher? I have professional and it seems to work but when I tested it in Reader, it failed to export.

I tested this in Adobe Reader 9 just with no luck

Thanks again
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Have you applied extended form rights to the PDF?

This is restricted in Reader and requires the extended form rights. See the Acrobat JS API Reference.

George Kaiser

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Actually that was in my first comment. Even though the reference states that this function should work in reader if the document Has Form Save Rights, it does not. At least on the versions I tested it on. You just have to try it out and see. That's what I do.

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

tsierra
Registered: Jul 24 2009
Posts: 43
Hello,

The did enable user rights for Reader.


I've tested the document on the Mac, so far so good.
I'm running tests on the PC tomorrow. Hopefully it will work
Thanks for all your help!