Skip to main content
Known Participant
February 5, 2016
Question

Importing from csv file

  • February 5, 2016
  • 1 reply
  • 1400 views

I have a list of records in a Excel csv file, the columns are named, Name, Address and Date. I want to import one record at a time from the csv file by pressing a button on a pdf form that will fill three text fields, named "Name, Address, and Date". Then each time I press the button, it will import the next record below the previous row that was imported?

This topic has been closed for replies.

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
February 5, 2016

Take a look here for information about the general mechanics of importing Excel data into a PDF form - you will need to use a tab separated text file, not a CSV file for this to work:

Can I import data from an Excel spreadsheet to a fillable PDF Form? (Create PDF)

To automate this in JavaScript, take a look here (this will automatically create all the forms that you have data form in your tab separated text file):

Batch-Import Excel Data into PDF Forms - KHKonsulting LLC

If you want to modify this code so that it only advances when you press a button, I would call the Doc.importTextData() method from that button, after the button increments the record counter.

senechiaAuthor
Known Participant
February 10, 2016

Ok... I've been playing around with this and I am totally lost. I get this error.

NotAllowedError: Security settings prevent access to this property or method.

Doc.importTextData:8:Field Import:Mouse Up

senechiaAuthor
Known Participant
February 10, 2016

I can import 1 record at a time, but not a batch import them.