Expand my Community achievements bar.

Help with Scripting

Avatar

Level 4

Greetings, XFA scripters.

How do I get started with XFA scripting?  Every JavaScript book I have looked at applies to web scripting. Where did you XFA scripters learn your JavaScript?

I am the self-taught type, so please don't recommend classes.  I'm just looking for resources to learn XFA scripting.  Thank you.

Paul - are you there?

7 Replies

Avatar

Level 10

Hi,

I know where you are coming from. I am not a coder and have picked by way through this for three years. What we have learnt is that there are significant differences between "core" Javascript; Acrobat (Acroform) Javascript; and LC Designer Javascript. We tend to stick with Javascript unless we are dealing with dates or time, for which we revert to Formcalc. For what its worth here are my top tips:

  1. Forums: great to ask a question and get feedback. We work alone with LC so don't have the opertunity to stick out heads over the partition to ask a question. Forums provide that for us!
  2. Check out Acrobat User Groups in your area.
  3. JP Terry's book "Adobe LiveCycle Designer" is great. It is laid out well and has great examples.
  4. www.pdfscripting.com This is a paid service, but is a great resource. While a lot of the script is orientated to Javascript for Acrobat (Acroforms) it is adaptable to LC Designer.
  5. Thom Parker recommended "Javascript the Definitive Guide" by David Flanagan. I must admit we are still working through this. However it is the FIRST Javascript book that we have come across that deals with "core" Javascript as a language. We had the same problem, that books in stores only appeared to deal with web sites. This book goes into the basics (to a deep, deep, deep level), but we have foundered when trying to implement some "core" Javescript solutions back into LC.  Forums to the rescue!!!!
  6. I like this Adobe guide. While it is for LC Designer 6, it is laid out in a very clear way. You can take a particular object and look at all the ways you can script for that object. http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
  7. Another Adobe reference is http://www.adobe.com/go/learn_lc_scriptingReference
  8. The help file is a good sanity check. Particularly when deciphering the differences between the different flavours of Javascript and which one is accepted in LC Designer.
  9. The PDF bible(s) skimp a bit on LC Javascript, but may help you out.

I am sure when the world spins around others will chip in with suggestions.

Good luck,

Niall

Avatar

Level 4

Ah.  Very nice of you, Niall.  Thank you very much.

Others reading this post  -   Please share how you learned XFA scripting. Anything at all that you can share about your first steps into XFA scripting would be appreciated.

Thanks again, Niall.  :-)

Avatar

Level 2

Hi Lakov,

I would add the following reference material to Niall's list:

XFA scripting     Adobe XML Form Object Model Reference

AcroJS             Acrobat JavaScript Scripting Reference

You can use both XFA scripting and AcroJS in XFA forms (forms built using LiveCycle Designer). You can do most things with both APIs, but XFA scripting is always my first choice. Occasionally, you will find something that can only be done in AcroJS, for instance setting a timeout with 'setTimeOut'.

For someone new to JavaScript, there is not much of the core JavaScript language that is needed. Basic constructs, including 'var', 'if', 'for' and 'function' will take you a long way. This can be picked up in any introductory JavaScript book or web reference. Where you will need to spend a little more time is learning the Adobe specific constructs, such as SOM expressions and events.

Ben Walsh

www.avoka.com

Avatar

Level 10

I've been learning mostly by looking at examples and asking questions. I used to do some coding a long time ago which helps.

I have gone through some Javascript tutorials and while they are all to do with websites the underlying structure is mostly the same. There are lots of free ones available on the web.

The examples that come with Livecycle are pretty good. And I'll second JP Terry's Book - it's got great examples. And I picked up a copy of PDF Forms Using Acrobat and LiveCycle Designer by Ted Padova and Angie Akamoto which has some useful stuff in it.

Avatar

Level 4

Thank you, Ben and Jono.

The resources provided by the three replies should keep me busy for some time.

Thank you all.

Avatar

Level 4

Niall,  Ben  and Jono,

Nine months after initially contemplating the topic, and now that I have had some good practice with the UI,  I feel ready for XFA proper. I have just revisited your replies and want to thank you again.

Avatar

Level 10

Iakov; glad I have been able to help.

I still feel that I am a beginner, and there are many around here who continually open my eyes to what can be done.

Especially Bruce! Who seems to have un-ending knowledge when it comes to Javascript and xml.

I used to do some coding many years ago, but it's all new to me now and have trouble wrapping my head around it sometimes.