Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Livecycle Javascript

Avatar

Former Community Member

I built a XFA based dynamic form template using livecycle. I heavily use javascript to look through the xml bound to a page and add rows to tables dynamically.

Example below:

var locationTotal = xfa.resolveNodes("Page1.dataNode.Location[*]").length;

var locationArray = new Array();

var i=0;

for (i=0; i<locationTotal; i++)

{

          locationArray[i] = xfa.resolveNode("Page1.dataNode.Location[" + i + "]");      

          var buildingTotal = xfa.resolveNodes("Page1.dataNode.Location[" + i + "].Building[*]").length;

          var buildingArray = new Array();

          var j=0;  

          for (j=0; j<buildingTotal ; j++)

          {

                    buildingArray[j] = xfa.resolveNode("Page1.dataNode.Location[" + i + "].Building[" + j + "]");

                    var buildingRow = BOPPolicyDocumentData.Page1.PropertyTableSubform.LocationSubform.AddressTable._Row1.addInstance(1);

                    buildingRow.LocNo.rawValue = locationArray[i].unitNumber.value;

  }

}

I use iText to merge the template and the xml. But from what I understand, iText does not run the javascript. The javascript needs to run at the client when the form is opened using acrobat reader.

This means the form cannot be viewed using other PDF readers which do not support javascript in them.

Also since the layout of such a form is determined when the form is opened rather than at the server, I cannot merge it with other dynamic PDFs to combine them all into one PDF.

Any advice on how I can eliminate javscript to run on the client side?

Thanks in advance!

Sirisha.

0 Replies