ISO FileMaker Magazine: FileMaker Video Tutorials, Templates, Help & More

FileMaker Deals

Video Browser

Scriptology Video Browser

Tools & Resources

Populating PDF Forms

Posted by: grantwood / Thursday, April 24, 2008 – 3:33pm

by Sean Mills

43
 minutes

If you're in an industry where standardized forms are the norm, then the holy grail is automatically pushing data from your database into the required PDF. Yes, it's true, we still live in a world where forms consume most of the process. And this probably won't change too much over the years.

If you've ever dreamed of taking those field values and shoving them right into the required form then the included technique file and videos in this mini series will provide you with everything you need.

Not only has the work been done but there's a ton to learn from this wonderfully crafted FileMaker solution. The file is ready-to-go, the solution is based on freely available technology and the videos are worth the price of admission.

Don't miss this series of videos if you have any desire to merge data from FileMaker into preexisting PDF forms!

Details: Released - 4/24/2008 / Size - 2.73 MB / Length - 43 min
Filed under: |
-
.

Can you show us more details !

.
.
.

Excellent work, but I am at lost when it comes to 2 issues :

1) how do you find out what the actual field names are, on a form that you have not created, otherwise how do you use your technique to populate a form like : http://www.dmv.ca.gov/forms/reg/reg195.pdf

2) Can you add the form like the above to your Tech file ?
do you have to recreate all the fields, since it is unrelated to what you have in your tech file ?

I hope this makes sense . Thank you

Xoomaster

.
.

Good Questions

.
.
.

@xoomaster

1) I can extract the fields names, including the accepted values used in checkboxes, radio buttons, etc. Then I could automatically create the key-value pairs to save you some time. You would only have to supply the values. A couple of issues when doing this:
* I couldn't differentiate between main and related keys, so I would just create main key-value pairs (your form doesn't have any related data)
* You might not populate all of the fields--you might just populate the text fields in Sections A and G, and after printing the form, the rest of it can be filled out by hand. So you could have a number of keys with no values, which should be OK

2) Yes, you can add the form to the technique file. In terms of integrating this technique file into your own solutions, you don't need the patient-related tables.

These are really good questions. I think I'll make a few changes to the technique file to address your questions. For #2 It will probably be better if I split the technique file into two files, one containing the patient-related data, and one containing the PDF-related data. I'll just need a little bit of time to do this, and I'll probably do a follow-up video that highlights the changes.

Keep the feedback coming!

Sean

.
.

Hi Sean,

.
.
.

Hi Sean,

My main confusion is about access to a preexisting PDF file/Form like I mentioned above.
You mentioned that

"1) I can extract the fields names, including the accepted values used in checkboxes, radio buttons, etc. Then I could automatically create the key-value pairs to save you some time. You would only have to supply the values."

How can you extract fields names and their accepted values on a form, without having Acrobat Professional ?
In your example you manually create these fields on the PDF file usingAcrobat Professional. So is it correct to assume that I would also need Acrobat Professional to do the same with the Form I mentioned above ?

Also the form I mentioned above, is "Locked" so even if I had Acrobat Professional, I don't think I can accurately find data related to the field's names ?

I don't know much about Acrobat, so I apologize for the above questions if they appear redundant.

I think your technique could have a huge impact on the way I do my forms at my work.

Thank you again.

Xoomaster

.
.

Extracting Field Names

.
.
.

@xoomaster

I would attempt to extract the field names using the same iText library that I use in the technique file. I wouldn't use Acrobat Professional. Since your DMV form is locked, I may not be able to extract the field names, but I'll try.

Sean

.
.

Extracting Field Names Screenshot

.
.
.

@xoomaster

Hey, I managed to figure out how to extract field names from locked forms. I needed to include two additional Java libraries, both free. I used your DMV form as a test, and here's a screenshot:
http://www.grantwoodtechnology.com/test/populating_pdf_forms_field_info_...

I could use your help with something. Should I automatically create a main key-value pair record for each field found? Maybe you don't want to populate every field, like some of the checkboxes. You would have to delete the unused key-value pairs, or you could just leave them, although that would add clutter.

Sean

.
.

This is awesome . I am very

.
.
.

This is awesome . I am very much interested in how you extracted the Filed names ?
To answer your question, Yes, it is much easier to delete what is not needed than to create. You could leave a dummy calculation in the field like "" if needed.

Here is a challenge :

Ideally, you want your users to just pick a PDF file and then automatically give them the "Name of the fields" in that PDF. At that time, they will have the option of creating their own calculations and key-value pairs and submitting only what they are interested in filling.

I appreciate your effort. Please let me know how to extract the field names though.

Xoomaster

.
.

iText Is Your Friend

.
.
.

@xoomaster

I used the iText library to extract the field names, although it couldn't extract field names from your form because it was secured, so I needed help in the form of two other libraries. Sometime soon I'll post the updated technique file so that everyone can inspect the script that extracts the field names (it's not a long script).

"Ideally, you want your users to just pick a PDF file and then automatically give them the "Name of the fields" in that PDF. At that time, they will have the option of creating their own calculations and key-value pairs and submitting only what they are interested in filling."

Well, this technique is really only meant for developers. I personally wouldn't want users trying to create calculations. That seems like a problem waiting to happen.

Sean

.
.

Problems Populating Your Secure Form

.
.
.

@xoomaster

While I can extract the field names from your DMV form, I'm having difficulty populating the form. According to the security settings, the filling of PDF form fields is allowed, so you would think that the fields could be filled programatically as well. Will have to research some more.

Sean

.
.

Let me know how it goes. I

.
.
.

Let me know how it goes. I had tried creating forms and doing Javascript for calculations within PDF forms, but PDFs are generally not easy to work with. One of the major problems include data import and export from and to PDFs.

Please remember the above form is just an example, so don't worry too much if it doesn't work out.
I do like to learn about the above process though.

.
.

Requirements

.
.
.

Does this solution require a particular version of FileMaker Pro? If so, what are the requirements?

.
.

Requires Version 9

.
.
.

@metamora

The solution requires version 9.

Sean

.
.

Just run through your pDF videos...

.
.
.

What a buzz!
Near the end of last video came a suggestion of getting data off the PDF forms across into filemaker. Is this still a project?
--
Would be really big for emailed applications, registrations ... lots.

Ross

.
.

Maybe

.
.
.

@rscholes

Maybe in a few months. Do you personally need the ability to extract data from PDF forms?

Sean

.
.

Excellent work

.
.
.

Excellent work

.