These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Automatically populating few fields in the Form from a Excel sheet .

pramod_kmr73
Registered: Mar 11 2008
Posts: 25

I am designing a form using actobat pro ver 8.

I need to populate a few fields in the form by taking the values from an excel sheet or csv file .

The client would be using Reader version . The excel sheet or csv file would be with the client.

i have enabled the extended rights for the Acrobat Reader.

How to go about doing this.

The client would keep some data example his Id, Address, Name etc which are frequently to be used in the Form in a Excel sheet of csv file. Because the data is small , i am not using any database like ms access.

Know how the client can get the form prepopulated with the values stored in the excel sheet/csv file when he starts to fill the PDF Form.

The response to my query has been excelledn in this forum. Inspite of bing a beginer , have been able to move ahead in my attempt quite quickly with the support and examples.

regards

pramod

mumbai, India.

My Product Information:
Acrobat Pro 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
To do this properly you'll need to write an automation script, that the user installs on thier system. There are some examples at JavaScript Corner that show how to create an automation script.

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/folder_level_scripts/

http://www.acrobatusers.com/tutorials/2007/10/apply_security_with_js/

In the automation script, use "doc.importTextData()" to load data from a "Tab Delimited File", not a CSV file. Excel will export one of these.

For this method to work, the fields on the form must exactly match the column names in the data file, and the Form must be Reader Enabled with Form Rights, which can be done from Acrobat 8 Pro.

The "doc.importTextData()" can only be executed from a script in a document if the path to the data file is not sepcified. Doing this, displays a file open dialog to the user, who then has to search for and select the data file. If this is acceptable, then you don't need create an automation script, but can place the code into the PDF form.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

pramod_kmr73
Registered: Mar 11 2008
Posts: 25
Can you please provide an example on how to do this. I mean a PDF Document sample that reads the Tab Delimited File and populates some fields automatically whent the document is opened.

regards

pramod
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
There is enough information in example 1 in the Acrobat JavaScript API Reference. You need to create a form using Acrobat Form tool, not LiveCycle Designer, and have three text fields called "First", "Middle", and "Last" and a button field. Add the script in the example to the button's "Mouse Up" action. Now you must put the example data into a tab delimited file, you can imput the data into Excel and then save as a tab delimited text file.

The biggest problem will be getting the path to the data file and if working with version 8 you will have to provide for the additional security restrictions and if Reader is being used the Extended Form Rights will have to be applied to the PDF.

George Kaiser