Hello,
I've set up my Livecycle PDF to read from an access database and populate a drop down menu with the values exactly like I'd like. I've come to find that the software that I'm interfacing with is going to be outputting to MySQL remotely. So far, LC Designer is not being terribly friendly with MySQL databases.
I've done some research and seen a common response of "use the doc.submitForm()" function, but the literature that I can find on this function is very slim, all across Google. And what I did find led me to believe this was just for populating simple text/number fields, but not drop downs or the like.
How would I best off doing this? I've also seen the method for parsing the MySQL values to XML via PHP, but that method seemed to require that you add an instance of code for each record in the database, and the number of records in the database could grow very fast, something I simply can't go in and add an instance for every time.
Any help is appreciated.
All "doc.submitForm()" does is move data in and out of form fields. That's it. when this function is called it takes all the form field data, packs it into the specified data format, and sends it to a server script using an HTTP Put. The server script then sends back data in one of the formats recognized by Acrobat. When Acrobat gets the response it tries to map the data in the return data into the form.
This simple transfer mechanism can be used for all kinds of stuff. For example, Setup a form with serveral hidden fields. Set the binding on these fields to Normal and the Binding on all the other fields to None. The submit ignores all fields that do not have a binding. These hidden fields are now the mechanism for transfering data in and out of the form. One of them could be a command, another for transferning data, and another as a status field.
You fill out the fields with the appropiate information and do a submit. The server script parses the information out of the data, builds an appropiate response, and sends it back. Code on the form waits for the return data by polling the status field. When the data comes back the script grabs the data out of the hidden fields and does something with it. For example, using it to popuplate your list fields.
Obviously this requires quite a bit of code on both the PDF and server sides. And it gets worse. If you want to have 2 modes of operations, one for form setup operations such as whats described above, and one for real data submission, then you'll have to also write code to dynamically switch the field binding.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script