I want to localize the captions of the fields in PDF Form developed using Adobe LiveCycle Designer 7.1.
In order to do that, I figured out that have to prepare XML Data Source of all Captions and related text in the target language.
The languages are English, Arabic and French. For each Language, there must be one XML File which will be the Data Source of the required captions, and the captions on the form will be bound to that XML Data Source.
I need to find automated way (programmatic or any other way) to generate the XML in a special format using input for a Table in any Database, say MS Access/SQL, as follows:
I have input table of Captions in all languages that looks like the following (see the Excel Sheet below for a sample input table):
Note: I am sorry as I do not know the French translation.
Using the above input table, I need to generate 3 separate XML Text Files as follows:
---- For Arabic --- الاسم العنوان تاريخ الميلاد عدد افراد الاسرة الجنسية
---- For English --- Name Address Date of Birth Family Members Nationality
---- For French --- xxx yyy xxx xxx yyy
The Input Table above is relatively huge, and it may change from time to time, therefore, it will be very important to generate XML using programmatic approach.
I was able to use Dynamic Property Biding to bind the captions and the tool tip text to such XML Data Source, but I am still facing some difficulties.
So, after generating the above XML Files one for each language, and do all the binding in LiveCycle Desinger, then before publishing the forms LIVE, I will create 3 copies of the PDF form, one for each language, and use Acrobat to import the Resource XML File (using Import Form Data Menu Option) of the related resource language file in the related PDF File, and save the PDF file.
To summarize: ============
1. Is this the correct approach for localization, or there is better one ?
2. How I can generate the above XML in an easy way from the input table shown in the link above ?
3. Can I control the direction the the PDF From so that I can make it From Right to Left for Arabic instead of from Left to Right ? I want to avoid making a new separate PDF specially form Arabic Language. The direction will affect the reading order and the Tab Order of the Fields and the location of the Objects on the Form.
I haven't put a lot of thought into 1 and 2 ... it's a Monday morning! 😉 As for 3 and 4:
3> This cannot be controlled at runtime, although it would be an excellent idea. You should log this as an enhancement request with Adobe.
4> You can use collections of fields. For example, name a field on page 1 "TextBox1" and on page 2 "TextBox1". You can then use a SOM notation with resolveNodes (note the 's' on Nodes, this is different from resolveNode) and make a call like:
var coll = xfa.resolveNodes("xfa.form.form1.#subform[*].TextBox[*]");
This will return an array of field object into 'coll' that you can loop through.
There is more detailed documentation on SOM wildcard notation in the following document under the "Reference Objects in Calculations and Scripts" heading:
However, I am still facing the following problems:
1. I could not flip Tables. Table cells and columns seem to have Static Layout during runtime, and you cannot revers the order of such cells/columns. Any idea how to flip tables (make them from Right to Left).
2. When I flip the subform recursively and dynamically during run-time, all affected fields in a subform will loose there tab order settings and reset to the default. Can you control Tab Orders during run-time ?
3. Static Text (text objects) cannot be bound to Dynamic Captions. So, I changed them to Text Fields, and reduced the size of the Entry Part to minimum, but during runtime, when tabbing, the cursor will stop on such fields, and looks a bit confusing. How I can skip the Tab Orders for such fields ?
4. I downloaded LiveCycle Designer 8.2 trial, and tried to use the new Followed Text Setting of Subforms to be Right to Left, and Top to Bottom "layout = rt-tb". As per the book, it should work, but it is not working. When I use such setting, the form will generate errors in runtime, and the layout will be messed up. Any idea what is going on ?
(Note: I will post the script I developed if needed).
When I bind the caption of an element in a repeating subform, and during runtime, when I add a new instance of the subform, only the first element will be bound to the translation, and the other instances are reverted back to the caption text from the design.