Link to home
Start Free TrialLog in
Avatar of billfinkri
billfinkri

asked on

How Do I Fill In An Adobe (Fillable) PDF File With Data From A Database

I'm new to Adobe (Professional 7.0) I'm actually self-teaching myself Adobe PRO. Please go easy (and VERY simple) on me?

I have 1 field of information stored in an Oracle database - called 'Name.' (There are actually more fields, but once I get this simple example out of the way, I can figure the rest out.)

How do I pass the information contained from the Oracle "Name" field to the Adobe (fillable) form so the end-user can print it out? (I explain it in much greater detail - see below.)

My thinking  - Is it this simple?
http://www.mysite.com/cgi-bin/Adobe_Form.PDF?name=NameData&address=AddressData...MorePost_Or_Get_Data_Here.

I'm utilizing and getting more and more familiar with Adobe Designer, but too self teaching myself. So if could go easy on me, help shed some light there too, it'd be a great big help. Such as, is it as simple as save the "fillable" Adobe form, and naming each field using the "Binding" name field to pass my information to?

I know how to program getting the data using a Web form via CGI into an Oracle DB, and then getting the information back out of the database.

If there is anyone so kind as to just leave one example of how to automatically fill-in one field say "name" and fill in the (fillable) Adobe form's "name" text box, when called from a Web form, I'd appreciate it. I consider this extremely difficult - at least from my point of view - points!

My (full and detailed explaination) example:

I have created a very simple HTML form for the user to fill in their name - then click submit.

Afrter the user clicks "Submit" - their name gets stored into my Oracle database, in the field name "Name".
(I'm fluent enough with Perl to get that accomplised - and then I'm able to retrieve the data in the "name" field using Perl.)

10 minutes later I wish to have an HTML form that states something like, "Who's Record Do You Wish To Retrieve? ... then have a "Submit" button. I'll supply them with a drop down box with the list of names from the Oracle DB "Names" field as a good example.

This time the user can select their record (or their name) and it retrieves the PDF with their name already filled in so they can print it.

Via CGI - I'm able to pass the data contained in the "name" field - but how do you call up the PDF file and pass the data to the Adobe "Name" text field?

Again, is it this simple?

http://www.mysite.com/cgi-bin/Adobe_Form.PDF?name=Name_Data

Have I confused the heck out you all?
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

No, it's not that simple - unfortunately. You have two choices: Server side merging and client side merging. Both would involve "FDF" - that's a file format defined by Adobe to send form data to e.g. Reader. It's a very simple format, so you can create FDF files based on the data in your database in e.g. Perl.

Such a FDF file can also contain a reference to a PDF file. In this case, your client would request the FDF file, and Acrobat (or Reader) would then automatically download the associated PDF file and merge the data into the form fields in the PDF file. The problem with this is that the form fields are still form fields, and somebody can modify them before printing them. This is the reason why merging the data on the server is usually the preferred solution. You can do this for free with a the pdftk tool: http://www.accesspdf.com/pdftk/

Let me know if this makes any sense, and if you need step by step instructions.
One more: If all your clients have the full version of Acrobat, and are running on Windows, you can also use the Acrobat JavaScript "ADBC" feature, which is Adobe's wrapper for ODBC so that your JavaScript program can access the database directly, and therefore fill the form fields without using FDF files.
Avatar of billfinkri
billfinkri

ASKER

KHKremer,

(Sorry, I didn't even notice there was a response.)

Go ahead and close this question.

I've probably asked the question with too much confusion.

Actually purchased an Adobe "support" contract, as THEY said I _could_ indeed do what I asked during our PRE_Purchase of our Adobe Pro7.

If you leave this question open, I'll let YOU know the outcome.
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It can be easily done in Crystal Reports.
http://www.businessobjects.com/

Sorry for taking so long to get this back to Ya'll!

This does NOT work. Matter of fact, after a number of person-to-person phone calls to Adobe, (Of which we paid for the support) I don't believe THEY know how to get it to work, EITHER.

Using THIS page as an example, try this:

http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf

their documentation is INCORRECT and they can NOT get my problem solved. (Sorry KhKREMER)

ALL I want to do is make a "fillable" form, use the URL 'http://myORG.Com/MyPDF.PDF#fdf=http://MyORG.Com/MyPDF.fdf" and it SHOULD fill in the my TWO fields.

I've been trying to work with TWO fields, "Name" and "Age" - (just to get the hang of it and get things rolling so I can finish my project) but Adobe is letting me, *US* down.

Step 1) Create A Word Document
Step 2) Print It As An Adobe Document
Step 2a) Bring It Back Into Acrobat
Step 3) Insert Text Boxes
            Fill 'em in
Step 4) Export The Data As An FDF File
Step 4a) Save The PDF File
Step 5) Put The Files In The SAME Directory With SAME Names in the HTDOCS folder on My Web-Site. (With the exception of suffix "FDF" vice "PDF"

i.e. "http://myOrg.COM/Name_Age.PDF" displays my document, but if I use "httpd://MyOrg.COM/Name_Age.PDF#fdf=HTTP://MyOrg.Com/Name_Age.fdf" - Nope!
I'll try to get this to work tonight. I'm pretty sure I've used this sucessfully in the past.
If you get it working

I will TRULY by YOU LUNCH !! Even if I have to send you a check!

(I'll be out of my office in NC the next coupld of days, but I *WILL* buy you lunch, and INSIST Adobe Hire You!) I'll be in my office today though.

(Get this, Adobe _PROMISED_ they'd call me back in 1 hour - at 8AM this AM! - What, East Coast, it's 10! Not a word Geeesh.)

Thanks, I know you don't have to put this much effort into this, so I'm thanking you ahead of time.

Regards,

Bill
Looks like you are right: It's not working. What I found out is that the syntax is correct, and Acrobat is actually retrieving the FDF file from the server (the connection does show up in my log files). However, it's not using the retrieved data to fill in the form fields.

The only way I could make it work was by modifying the FDF file, and replacing the value associated with the /F field (the original file name) with the URL of the PDF file (in your case this would be something like /F (http://myOrg.COM/Name_Age.PDF)
When you now open the _FDF_ file in the browser, Acrobat will automatically retrieve the associated PDF, and will fill in the form fields.

However, I still stand by my first comment: It's best to merge the data on the server, and send just the merged PDF file to the client.

Really - thanks for taking so much of your time. (I know how valuable all of our time is these days.)

I'll give that a shot, and get back to you first thing.

Your example is exactly what I wish to do.

(Let me get this straight, though.) It's the FDF file is what contains the "HTTP" reference to the PDF that I wish to have the fields automatically populated with ???

Regards,

Bill
Yes, this is correct. Because the the FDF file contains the reference file, you need to load the FDF file into your browser (by e.g. creating a link to the FDF file in a web page).

Open your FDF file in a text editor. Look for something that looks like "/F (filename.pdf)" (this would of course refer to your PDF file). Just replace the file name with the URL of your PDF file.
Boy-oh-boy, thanks for your patience.

Here is my "Page" - The reason I put "My Site" is this is a DoD facility, thus obvious reasons.

<html>
<head>
<title>Title Goes Here</title>
</head>
<body>
<a href="http://MySite:Portxx/Name_Address.PDF#fdf=http://MySite:Portxx/Name_Address.FDF">Click Me</a>
</body>
</html>

This comes up with the file you're looking for is a PDF that is supposed to have the values filled in, would you like to look for that PDF??? (Something to that effect!)
This is odd... With all my attempts I always got the PDF, just without the data filled in. Do you get the same message if you leave off the "#fdf=..." part?
Did you try to just link to the FDF file?
Yes, if I leave the "#FDF" in or out, I get the PDF.

Here is my HTML page - BOTH Links return the same results. They display the PDF file, but no fields filled in.

(Get this, I put up so much stink with Adobe yesterday, THEY GAVE ME THE FDF TOOLKIT!) - It's free, I'll leave it some place if you like? ('long as it's legal of course.)

<html>
<head>
<title>Title Goes Here</title>
</head>
<body>
<a href="http://OurSite.COM:7778/Name_Address.PDF">Click Me</a>
<br><p>
<a href="http://OurSite.Com:7778/Name_Address.PDF#fdf=http://OurSite.Com:7778/Name_Address.PDF">Click Me WITH FDF Appended!</a>
</body>
</html>

I gotta hand it to ya, you've more patience that I have ... this is weird, challenging, but weird. 'specially when Adobe uses the example in THEIR Docs!
Try this:


<html>
<head>
<title>Title Goes Here</title>
</head>
<body>
<a href="http://OurSite.COM:7778/Name_Address.FDF">Click Me</a>
</body>
</html>


This does require that you modify the FDF file so that it links to your PDF file.

BTW: Even though the FDFToolkit is free, you don't have the right to redistribute it, so please don't "leave it some place" :-)
(Sorry 'bout the Toolkit - I did mentioned "As Long As It's Legal." It is indeed free, but the users need register. (That's all.)

RE: The Original Problem.

If you're familiar with Perl, they have a PERFECT example of how to do what I wish to do, but you have to load a Perl Module "Acrobat::FDF" - (get this) Which doesn't exist!

...lastly, the FDF file, (above) I've tried modifying it to point to the "PDF" file with or withOUT the "URL" reference.

Here's the FDF file: (ALL of it.)

%FDF-1.2
%âãÏÓ
1 0 obj<</FDF<</Fields[<</T(Text2)/V(Name_Here_Modified)>><</T(Text1)/V(Add_Here)>>]/ID[<733C4C4716C8C6A23D120EE0467B259C><128EDD8F82C114429380357B4A9CAFA1>]/F(Name_Address.PDF)>>>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
Use this: (replace OurSite.COM:778 with the correct information about your server!)

%FDF-1.2
%âãÏÓ
1 0 obj<</FDF<</Fields[<</T(Text2)/V(Name_Here_Modified)>><</T(Text1)/V(Add_Here)>>]/ID[<733C4C4716C8C6A23D120EE0467B259C><128EDD8F82C114429380357B4A9CAFA1>]/F(http://OurSite.COM:778Name_Address.PDF)>>>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
WOW - WOW - WOW, IT WORKS!!!

Get this - (Coincidence, PROBABLY not - and I can't thank you enough for your time.)

What I ended up HAVING to do, is after making a change to the "FDF" file, (to see the changed results in the PDF fields) I had to CLOSE the BROWSER completely, (even though I inserted meta tags to expire the "load_pdf.html" page)

... and now it works.

If I could give you a 1,000 points, you deserve it!

Another finding is that BOTH links worked, with or withOUT the "#FDF=" in the URL!!!
(You had a type-oh in yours - none-the-less, THANK YOU, THANK YOU, THANK YOU! You save me such a great deal of time - I was actually ALMOST ready to give it up!)

With The Kindest Of Regards,

Bill

I will leave my example HTML pages for others to learn from:

<html>
<head>
<title>Title Goes Here</title>
<META http-equiv="Expires" content="Tue, 01 Oct 1956 08:30:00 GMT">
</head>
<body>
<a href="http://FQDN.com:7778/Name_Address.fdf">Click Me</a>
<br><p>
<a href="http://FQDN.com:7778/Name_Address.FDF#fdf=http://FQDN:7778/Name_Address.FDF">Click Me WITH FDF Appended!</a>
</body>
</html>

============

Your FDF Example (That worked, TOO!)

%FDF-1.2
%âãÏÓ
1 0 obj<</FDF<</Fields[<</T(Text2)/V(Name_Here_Modified)>><</T(Text1)/V(Add_Here)>>]/ID[<733C4C4716C8C6A23D120EE0467B259C><128EDD8F82C114429380357B4A9CAFA1>]/F(http://OurSite.COM:778Name_Address.PDF)>>>>
endobj
trailer
<</Root 1 0 R>>
%%EOF


Lastly - would it have made a difference if I saved the FDF using WordPad vice Notepad - that's the ONLY other symptom that I can think of that may have caused it to work.

Again, Regards, Bill
(Moderator) Can I RE-OPEN this to award MORE points?

Just take a look at this thread, "khkremer" certainly deserves additional credit for this one, far and above the call of duty!
It probably would not have made a difference if you used a different editor. Because you are already linking to the FDF file, you don't need the #fdf=... command anymore. Acrobat already has access to the FDF file, and as long as the /F information is correct, it will find the PDF and populate the fields with the data from the FDF file.

500 pt is the maximum per question. Just look at it this way: Your question was not answered when you accepted what you thought was an answer, and it just took a little longer to find the correct solution. That's all included in 500 pts :-)
Well, I certainly am very thankful for your time. (Didn't I say I'd buy you lunch? Hole me to it!)

Thanks. Maybe I can return the favor sometime, too.

With Kindest Regards,

Bill