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

Placing Javascript in an FDF

synergy
Registered: Feb 23 2007
Posts: 33

I'm currently sending an FDF response to a form to tell the user (Acrobat Reader) that their data has been collected by the server script, this response places the message in a named field on the form.
 
However, I would prefer to open an application response box with the same message. I can write the javascript code for this but I have no idea how to insert it into the FDF response.

My Product Information:
Acrobat Connect 7.0.9, Windows
pddesigner
Registered: Jul 9 2006
Posts: 858
On the submit button, you could create a mouse down action to send the form and a mouse up action to display an app.alert message on the same button.

Or place the app.alert message as a Page Close action.

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is an excellent strategy. Send the user a useful message in the return FDF. The entire FDF spec is in chapter 8.6.6 of the PDF Specification. It shows where scripts can appear in the FDF, and there are plenty. You can reprogram scripts in the PDF or set scripts to run before or after FDF data is applied to the PDF.

The FDFToolkit, a server side library, which is a free download from Adobe has functiions to build the FDF format with various scripts, although, probably not what you want, which is a "Before" or "After" script.

Simple FDFs are easy enough to build manually in a string. Unfortunately I can't place a sample here because the format uses lots of angle brackets, which are a no no in this forum. But you can download it from.

[url=http://www.windjack.com/DownLoads/DataWJavaScript.fdf]http://www.windjack.com/DownLoads/DataWJavaScript.fdf[/url]

The FDF contains some field data and 3 scripts. One script that will be added to the PDF's document Scripts, one Before script, and one After script.
Notice that it does not contain a file specification. This is very important.

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