Skip to main content
Maximilion_Ma
Known Participant
April 20, 2018
Answered

How to use external data to fill in an existing PDF form in JavaScript?

  • April 20, 2018
  • 2 replies
  • 5245 views

Hi all,

I've got a question which is : I have data from a database, now I need to use the data to fill in a PDF form?

To be more specific, for example, there are "name", "phone number" and "address" fields in my database, I want to catch these data to fill in an existing PDF form. The PDF form also has these three fields. I have no idea about how to implement in JavaScript. Really need some help.

Thank you so much for any suggestion.

Cheers,

Max

This topic has been closed for replies.
Correct answer Karl Heinz Kremer

As was already suggested, you can export your data to a (tab separated) text file and then import that data into a form. If you can add some "glue" functionality to your database server, you might be able to do this with direct access from within a PDF form:

Connect to Database from PDF Form - This Time Without SOAP - KHKonsulting LLC

Getting a Serial Number Into a Form Using SOAP - KHKonsulting LLC

And, if you want to fill out more than one form at a time, take a look here:

Batch-Import Excel Data into PDF Forms - KHKonsulting LLC

Batch-Import List Data into PDF Form - KHKonsulting LLC 

2 replies

Karl Heinz  Kremer
Community Expert
Karl Heinz KremerCommunity ExpertCorrect answer
Community Expert
April 20, 2018

As was already suggested, you can export your data to a (tab separated) text file and then import that data into a form. If you can add some "glue" functionality to your database server, you might be able to do this with direct access from within a PDF form:

Connect to Database from PDF Form - This Time Without SOAP - KHKonsulting LLC

Getting a Serial Number Into a Form Using SOAP - KHKonsulting LLC

And, if you want to fill out more than one form at a time, take a look here:

Batch-Import Excel Data into PDF Forms - KHKonsulting LLC

Batch-Import List Data into PDF Form - KHKonsulting LLC 

Maximilion_Ma
Known Participant
April 26, 2018

Hi Karl,

Thank you for your reply. I am still having a question that seeks some suggestions.

In the link of "Batch-Import list data into pdf form", I can understand that in the code part, it is to create a temporary document to store the data from txt file. But I can not find how to import that existed pdf "sign-in sheet" and how to generate that pdf form to be ready to download. I mean, how to get this generated pdf "sign-in sheet", I am a little bit confused because I am still a beginner for javascript currently.

Really appreciate for your help.

Changjian

Karl Heinz  Kremer
Community Expert
Community Expert
April 26, 2018

I see that you've posted a separate question and already received a lot of information, so I will not comment on this any further.

try67
Community Expert
Community Expert
April 20, 2018

You can't connect directly to a DB from an Acrobat PDF (any longer).

You would need to export the data into a plain-text file and then it would be possible.