Hi,
I'm new to Acrobat JavaScript and Forms, but am a programmer in other environments. I am using Acrobat Professional 7.0 and Adobe Designer. The users will be using Acrobat Reader. I have a client-supplied PDF form with fields. I want to collect some information from the user and auto-fill the fields from a database.
I thought I would just add some combo boxes to the form to gather the lookup parameters and then be on my way. I added my first combo box at the top of the form using Adobe Designer, set up a data connection, and can see the first record in the combo box. But when I click on it in Acrobat Pro or Acrobat Reader, I get the "error sound", and no list dropping down.
I want the user to see these combo boxes only for data lookup. I do not want them printed in the final document. When I checked the document restrictions (Show Security Settings for this Document / Security tab), I see that changing the document is not allowed.
Is that my problem?
Can I change the restrictions?
Is there a better way to have the user provide selections to do a database lookup?
Can I essentially pass startup parameters to Acrobat Reader and do the lookup in document-level Javascript?
Sorry for my meandering questions, I just want to make sure I don't leave out a valid approach.
Thanks in advance for any ideas,
Ray
You can prepopulate list items from a DataConnection, i.e., anything in the LC DataView. Unfortunately this feature was added to LC Designer in version 7.1.
The next issue is that DB acess is something that can only be done in Acrobat Pro or Standard, and on Windows. It's not available in Reader or on the MAC.
But there is another way, and that's through the internet. Acrobat can perform HTTP Get and Post operations, and recieve data back from the server. This method will work on Acrobat and Reader for version 3 and later, and on the Mac and Windows platforms. Look in the JavaScript Reference at the "doc.submitForm()" function. This is the function that initiates HTTP request. All you have to do is write a server script that retrieves data form the DB, and returns it to Acrobat. To gain more control over the data transfer process I usually return data to invisble fields. Then use scripts on the LC form to parse and copy the data into the appropiate fields.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script