Donate!
SourceForge.net Logo
Valid XHTML 1.0!

FDF Toolkit and php-fdftk

BEFORE YOU BEGIN:
If you are planning or developing a new PHP application that needs to operate with PDF forms data, I strongly recommend to use XFDF format instead of FDF. You won't need any additional libraries because XFDF is XML-based. Plus, there are all signs that Adobe is gradually phasing out FDF in favor of XFDF (for example, they don't even let you download FDF Toolkit anymore, you have to request it from them). Have a look at XFDF Specification.

However, if you are stuck with some legacy PHP code or PDF forms that post FDF-formatted data, go on and continue reading...

FDF Toolkit is a library released by Adobe Systems Inc. that can be used to create FDF-files (data sets for use with PDF forms. For more information on FDF support in PHP see http://www.php.net/manual/en/ref.fdf.php.

To enable FDF support with your "factory" PHP you'll need to:

  • Download and install the FDF Toolkit
  • Download and install the php-fdftk package

Downloading and Installing the FDF Toolkit

Follow these steps to download and install the FDF Toolkit:

  1. Adobe no longer provides the FDF Toolkit for download. You can (theoretically;) obtain one by filling out the request form at http://partners.adobe.com/public/developer/acrobat/fdf/topic.html.
  2. if you succeed in convincing Adobe they need to give FDF Toolkit to you (or got it from your friends), you should have it as: FDFToolkitForUnix.tar.gz.
  3. at this point, you may either install FDF Toolkit manually or create a RPM from the archive and install it as RPM:
    • to install FDF Toolkit manually, you need to copy the file Headers and Libraries/LINUX/libFdfTk.so from the archive to any of the library directories (such as /usr/lib) and issue ldconfig.
    • to create an RPM package from this archive, download the source RPM here:
      DistroPackageLicense
      all
      The nosource RPM used to build libfdftk package from FDF Toolkit tarball
      GPL
      then copy FDFToolkitForUnix.tar.gz to your RPM SOURCES directory, run rpmbuild and install the RPM. Here is how you do it:

      RedHat:

      # cp FDFToolkitForUnix.tar.gz /usr/src/redhat/SOURCES # rpmbuild --rebuild libfdftk-6-release#.nosrc.rpm # cd /usr/src/redhat/RPMS/i386 # rpm -ivh libfdftk-6-release#.i386.rpm
      NOTE: the User License Agreement between you and Adobe Systems Inc. does not allow you to redistribute the resulting binary RPM.
  4. To check if you have correctly installed libFdfTk.so, try this:
    # ldconfig -v | grep -i fdf
            libFdfTk.so -> libFdfTk.so
    
    You should get the second line as output if everything went well.

Installing php-fdftk

Once you are finished with installing the FDF Toolkit, download and install one of the following RPMs to enable FDF support in PHP:

DistroPackageLicense
FC4
FC3
FC2
RHEL3
RHEL4
FDF Toolkit support for PHP on Fedora Core 2-3 and Red Hat Enterprise Linux 3
PHP
PHP
PHP
PHP

Source

If you want to rebuild the php-fdftk RPMs yourself, download the source files from the SourceForge File Release System. In addition to the nosrc.rpm-s you'll need PHP source tarball (tar.bz) used in your distribution.

FDF Toolkit 6 and Perl

The SRPMs above DO NOT package Perl modules supplied by Adobe. For one good reason - it seems that Perl support is broken in version 6, even though the headers are there. I was getting loader errors on all distributions I have tried it on and could not get it to work.

Tom K. was kind enough to email me on the subject and point out that FDF Toolkit 6 works with Perl 5.6. Since most RPM-based distributions are way ahead of Perl 5.6 (RHEL is 5.8 as of now), I decided to keep the SRPM as-is.

©2008 phprpms.sf.net