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
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.