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

help with exportAsFDF

lopi007
Registered: Jul 7 2011
Posts: 11

Hi everyone,
I need help with javascript. I want to save the data in FDF format. But I can not take place at the right way to do it.
here is part of the code:
 
var myFileName this.getField = ("51"). valueAsString + "" + this.getField ("52"). valueAsString +. "fdf";
/ / Add folder name
myFileName = "Desktop \ database \" + myFileName;
 
this.exportAsFDF ({cPath: myFileName, aFields ["cisloSmlouvy", "sex", "lastname", "name", "rodinnyStav", "rodCislo", "datNarozeni", "mistoNarozeni", "statNarozeni", "statniObcanstvi "" prukazTotoznosti "," cisloPrukazu "," platnostDo "," vadal "," street "," cisloDomu "," PSC "," municipality "," stat "," ball "," kCisloDomu "," kPsc ""kObec", "kStat", "occupation", "datumNatDoSoucZam", "phone "],});
 
Thank you all for your help

maxwyss
Registered: Jul 25 2006
Posts: 255
Do you get any error messages? You may have to fully activate the Console for doing that (in the JavaScript tab of the Preferences).

Just at a very quick glance, there are a few things which are not quite correct.

• setting the path name: the backslash before the quote in front of the "+" character makes the quote to be part of the string, which means that you will get an unterminated string, and " + myFileName;" becomes a literal. Also, you will need the absolute path in correct syntax. The easiest way to get the proper path is to place a PDF into the target directory, open it, and then run

this.path

from the Console.

This will give you the correct syntax…

• field names: unless your field names have spaces at the beginning and the end, you'd have to look at the way you specify them in the code. Make sure that the quotes are directly before and after the name; also make sure that the names are spelled correctly.

• list of arguments for exportAsFDF: there is a comma after the last argument; in this notation, you should not have a comma at the end of the arguent list.

Hope this can help.

Max Wyss.

lopi007
Registered: Jul 7 2011
Posts: 11
Thank you for your contribution.
But when I enter the code in the button so I get an error message.

I'd like to ask jedtli anyone know how to specify a relative path?
example:
% desktop% / myFolder