I have searched and found out code snippet for getting a value for particular field in a PDF using javascript in Acrobat.
But I need to get all fields as key-value pair in javascript. I tried some of the code but it won't work for me.
if(this.hostContainer) {
var names = new Array();
names[0] = this.getField("personal.name").value.toString();
names[1] = this.getField("personal.loginname").value.toString();
try{
this.hostContainer.postMessage(names);
}
catch(e){
app.alert(e.message);
}
}
PDF file looks like below,
Name : x (editable)
Age : 36 (editable)
Sex : male (editable)
But the form fields in PDF may vary.