Output and the Use of Acrobat APIs

Recently I was on-site with a development team, and a developer couldn’t figure out why certain functionality wasn’t working in Output.

He developed an XDP-based document that contained functionality (written in Javascript) to display the right information based on certain conditions. When previewing the form in Forms Designer the desired functionality worked correctly.

Looking at the server-log we saw the following things :

WARN  [com.adobe.document.XMLFormService] ALC-XTG-029-292: [3076] Script failed (language is javascript; context is xfa[0].form[0].form1[0])
script=form1.Text2.rawValue = util.printd( “dd/mm/yyyy”, new Date() );
WARN  [com.adobe.document.XMLFormService] ALC-XTG-029-459: [3076] Error: util is undefined

Why?

So the question is : why is  the util-api undefined?
And the answer is simple: because it is an Acrobat-only api which is not available in Output.

That is also the reason why it is working in Forms Designer, but not when you generate the document via Output. When you preview a document in Designer, you are using Reader/Acrobat.

If you want to see a full list of the available Acrobat-apis look here.

Solution

The solution for this problem is to avoid using Acrobat-apis in Output-only related documents, and use other apis that are available in Output. For example if you try to parse xml via the XMLData-api, you can also use the E4X-functionality in Javascript.

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 9.0/10 (2 votes cast)
Output and the Use of Acrobat APIs, 9.0 out of 10 based on 2 ratings

About Feike Visser

Feike Visser (@heervisscher) is an experienced consultant working in the EMEA-region. Feike has done live implementations at large enterprises like NATO, BBC, Philips, Deutsche Bank, HMRC, HSBC.
This entry was posted in Adobe LiveCycle ES2 (9.0.x) and tagged , , . Bookmark the permalink.

Comments are closed.