Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need answer to whether adobe acrobat can pull data from sql 1

Status
Not open for further replies.

MrHelpMe

Technical User
May 1, 2001
203
CA
Hello,

I am researching an issue for my company. Because the look and feel of what I am trying to do using Crystal Reports is not great I need to resort to other software packages. To explain, I have a government form(pdf), that I need to display and connect somehow to sql server database and pull information that I need from that database. So for example, I need to tap into a database and fill in all the fields on the pdf form with user information. Is this possible. I have installed the full version of Adobe Acrobat 5.0. Is this not the correct version or software that I should be using. Is there a better software package to handle this. I know crystal reports can do this as I achieved, however, once I put this report on the web, the pdf dpi are lost. I have no idea how to fix it(have even tried the registry fixes) so someone told me adobe acrobat can do the same thing. Your help is appreciated

Sal
 
Thanks for trying.

misscrf

Management is doing things right, leadership is doing the right things
 
lol. It does sound cool, its just not what I am looking to do. You have to understand, the goal is to fill the form out for them, not save the form they fill out. For this particular project, we have 40,000 records to choose from. Its big!

But that's really nice of you to offer. Maybe someone else will see the post and take you up on the offer!

misscrf

Management is doing things right, leadership is doing the right things
 
I know we should drop this, but "filling out the form for them " is exactly what I'm proposing. If you click on:


that is exacly what happens. The PDF (form01.pdf) is filled out with the data in the FDF. And generating that FDF from an Access or SQL database with a web app would be a snap.


Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
ok, I got an error that said this file does not exist. My confusion is that I thought this meant that an fdf file was created for each record. How does the user select the record they want ( from a pretty interface/search) and select that record to merge with the pdf?
go ahead, wow me with how you can solve this one!

misscrf

Management is doing things right, leadership is doing the right things
 
Data is in Server.

1) User goes to a web page, and selects a client.

2) The Web app connects to a database, and retrieves that client's data.

3) Web app creates an in-memory FDF, and streams it back to the user.

4) The FDF, now in the user's browser, connects to the server to retrieve the PDF.

5) The PDF, properly filled-out, is now displayed in the user's browser.

The FDF never was written to any hard-drive, so there is nothing to "clean up".

I'll write a sample application for you to test.


Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Here is a very quick and dirty application:


I chose PHP as the coding language, but it could just as easily be ASP.NET, ASP, etc. Same with the database. I build a very rudimentary database in MySql, but any database would work.

Here is what happens:

1) "fdf_data.php" queries a database, and display a list of names.

2) Clicking one of those names takes you to "fdf_query.php".

3) "fdf_query.php" queries the database for that name's complete data. It then builds an FDF using that data, and serves it back to the browser.

4) The browser loads Acrobat to process the PDF.

5) Acrobat reads the name of the PDF the FDF, and gets it from the server.

6) "fw9.pdf" loads in the browser, and Acrobat combines the PDF and the FDF.

7) Done. The user now has a completed PDF form.

Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
ok, so answer this for me, if you can...

How did the list of names end up on the query page?

This does have great possibilities! I think this might be useful to me.

Just to let you know where I am at, this current project uses data that the staff works on in a custom app. This app has a way for a user to go to a clients name, go to a tab, select multiple word docs ( pretend they are the same as a bunch of pdf forms) and then that clients record merges with all of them. This is good because when this department uses these forms, it is a bunch of forms for one client at a time.

In any event, other departments use their forms differently. I am sure that there is a department that has to fill out the same form many times for different clients, and this would be wonderful. Is it hard to set up?

Could I set this up realistically for lots of different forms to lots of different data sources?

Can I control access to it? ie network login?, it would go on intranet I suppose...

misscrf

Management is doing things right, leadership is doing the right things
 
Q: How did the list of names end up on the query page?
A: A PHP program queried the database and ouput the results as HTML:

Code:
<body>
<p>Click one of the following names to load that person's data into a PDF Form:</p>
<br/>

<?
$sql = 'SELECT name FROM `misscrf` LIMIT 0, 30';
ShowNames($sql);
?>

<?
function ShowNames($sql)
  {
    $res = mysql_query($sql);
    while ($row = mysql_fetch_array($res, MYSQL_ASSOC))
    {
      foreach ($row as $value)
      {
        echo "<a target='_blank' href='fdf_query.php?name=$value'>$value</a><br/>";
      }
    }
  }
?>
</body>

Q: Could I set this up realistically for lots of different forms to lots of different data sources?

A: The FDF format points to a PDF. The PDF has to have field names that match the FDF. As long as that is the case, the same form data can be attached to an indefinite number of forms. In fact, the web app could have two choices: pick the client, pick the form.

Q: Can I control access to it? ie network login?, it would go on intranet I suppose...

A: It's a web app. You can create any security you like, including custom written, integrated IIS or Apache, or Windows based security.

My point with all of this is to show, while no pre-packaged, wizard-driven, dummy-proof, Learn Spanish in 7 Days solution exists for populating PDF Forms (unless you want to pay a LOT of money), if you care to do a little programming, you can create your own very effective solution.

But it IS programming. Surely your organization has programmers, and you can show them what I've done as a starting point. If not, we can talk privately.




Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Thanks for all of your help. The powers that be want me to create this within our custom program for now. The reason for this is, that our users will open this program, select a client record and select a bunch of forms for that one client. Pretend they are buying a house. LOTS of forms. This allows our staff to select the client, select every form that they want, and then print. The pain in the butt thing was that I wasn't shown the whole program at first, so I was led to believe that our goal was to keep this in PDF.

In the future this may be useful though, so thank you for explaining it all to me.

misscrf

Management is doing things right, leadership is doing the right things
 
No problem, good luck. I've written forms/data/printing management programs for international banks, small Texas cities, the largest commericial printing company in the U.S., and a rural telephone company in Montana. If I can be of further help, let me know.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top