RE: PDF's and DB's
| From: | Nold, Mark | Date: | Tue, 08 Aug 2000 07:04:33 +0000 |
| Subject: | RE: PDF's and DB's | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1844@lists.php.net to get a copy of this message | ||
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
You can actually be a little trickier with PDF's...
1. Why not redirect the user to the created PDF file? There are some
problems with this as Acrobat tends to try to download the same doco twice
but yo0u can get this to work quite nicely.
2. Why not create your whole PDF file yourself? PDFlib is apparently very
good though i've never used it. There were problems with this under Windows
but i dont know the current status. I've have however seen various output
and it is extremely impressive.
3. I use htmldoc (www.easysw.com/htmldoc) to create PDF's on the fly and it
works very nicely. As long as your PDF needs can be expressed as tables etc
this may be the answer. Its crossplatform and not as big and expensive as
Acrobat.
Have fun,
mn
-----Original Message-----
From: Mark McCray [mailto:mm@tbwachiat.com]
Sent: Tuesday, August 08, 2000 9:13 AM
To: php-db@lists.php.net
Subject: PDF's and DB's
Hey everyone,
I posted a question a little while ago asking how you can get information
from a database into a PDF via a web browser. Well, I've figured it out. So
I thought I'd share the wealth.
1. You have to have Acrobat and be able to use it to create forms in a PDF.
We took the W4 form from the tax web site and used it because it already had
fields created in it.
2. You have to create an FDF file. This is a Acrobat Forms Definition file.
The format of the file is not that hard to figure out. You can get
reference for it by going to the Adobe Website.
The FDF file that you create really is only a text file in a specific
format. So you could use PHP to query the database for the information
needed to fill out the form. Then open a file handle and spit out the FDF
information interspersed with the database information. Just like you would
display information from a database on a page, you would just echo it to the
file.
3. Once you've created the file successfully, you can just give them a link
to click which will bring them to the the FDF file you just made.
4. The trick in getting the FDF file to populate a specific PDF file is
in the '/F' tag in the FDF file. The /F tag lets you specify which PDF file
you want to import your FDF file into. And lo and behold, it lets you link
to a web server.
For example, I've created an FDF file called w4import.fdf. I've created a
link that will ask to display this FDF file. Within the FDF file I've told
it to open a PDF at http://www.webserver.com/w42000.pdf. As long as you
have the PDF Viewer plug-in installed and you've also created a mime type
that you web server hands out and your Web Browser understands, then the FDF
file will open the PDF file and viola. Your PDF will be filled out on
screen.
You should check out this link as it has the documentation that you'll need.
http://partners.adobe.com/asn/developer/acrosdk/forms.html
Enjoy!
Marky