0
votes

I learned that adobe acrobat js api has method Field->setAction. http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/AcrobatDC_js_api_reference.pdf

Is there way to get Field Calculation in concole in Acrobat pro?

My goal is - to print in console all calculations performed on given PDF page. Then i can copy and save it as json/text file.

function getCalculations(pageN){
 for ( var i = 0; i < this.numFields; i++) {
  var fname = this.getNthFieldName(i);
  var field = getField(fname);
   if(pageN == field.page){
         //todo console.println(field->getAction somehow)
   }

 }
}

Thanks

2

2 Answers

0
votes

A getAction() method has not been implemented. Feature Requests have been made, but Adobe has not really reacted positively to them.

One point of difficulty is that there are also non-JavaScript actions possible, and then, the question is what to do in such a caseā€¦

0
votes

If your goal is to simply list the JavasScripts so that you can manually copy them to a text file, you can simply select "All JavaScripts" from the JavaScript toolbar. This will open a dialog with all of the document scripts with commented out XML tags as references to where they go in the document, page, and form fields. Converting that to JSON should be pretty easy.