Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Adobe Acrobat Javascript compatibility

AmiAdobe
Level 2
Level 2

Hello,

 

can't find a reference of supported Javascript functions for Adobe Acrobat Forms created in LiveCycle.

 

Does PDF javascript supports as example array.push and everything related to Array?

I can't add element to an array.

 

Thak you very much

 

 

1 Accepted Solution
Kosta_Prokopiu1
Correct answer by
Employee
Employee

XFA supports all standard functions of basic JavaScript/ECMA including Array.push()

 

var aArray = new Array();
aArray.push("test");
aArray.push("test2");
app.alert(aArray)

 

renders

Kosta_Prokopiu1_0-1608018529442.png

 

View solution in original post

0 Replies
Kosta_Prokopiu1
Correct answer by
Employee
Employee

XFA supports all standard functions of basic JavaScript/ECMA including Array.push()

 

var aArray = new Array();
aArray.push("test");
aArray.push("test2");
app.alert(aArray)

 

renders

Kosta_Prokopiu1_0-1608018529442.png

 

View solution in original post

radzmar
Level 10
Level 10

There's an overview which functions from Acrobat JavaScript API you can use. You'll find it in the scripting basics reference: https://helpx.adobe.com/pdf/aem-forms/6-2/scripting-basics.pdf
Generally you can use any JavaScript function defined by ECMA-262 5th edition, not just the those definded by Acrobat DC JavaScript API: https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/AcrobatDC_js_api_reference.pdf

 

For arrays just use:

 

var aValues = []; // Create an empty array
aValues.push("A new value");
aValues.push("Another new value");

xfa.host.messageBox(aValues.join("\n"));
AmiAdobe
Level 2
Level 2

Thank you very much for the reply.

 

Does this works when the script runs in server side?