Got bit closer with this.
The first problem is that I’m on MAMP which is looking in /usr/bin/pdftk but pdftk puts the link in /usr/bin/local/pdftk. Consequently, @shell_exec("which pdftk") returned NULL.
I resolved that by creating a symlink: sudo ln -s /usr/local/bin/pdftk /usr/bin/pdftk
However, the plugin still couldn’t find any fields in the uploaded PDF. Looking at the AJAX call I could see:
error2: "PDFTK returned no fields.",
I traced that down to $fields_data = shell_exec("pdftk '$file' dump_data_fields_utf8 2> /dev/null"); which was returning NULL. Executing the same command in terminal (with the $file variable resolved to the correct file path) worked fine. So did the following in PHP:
@shell_exec("/usr/local/bin/pdftk '$file' dump_data_fields_utf8 2> /dev/null");
However, executing the following through terminal:
/usr/bin/pdftk '... absolute path to file ...' dump_data_fields_utf8 2> /dev/null
returns:
Trace/BPT trap: 5
so it would seen that the symlink isn’t executing. Consequently, neither is the PHP call (which is using the symlink).
That’s as far as I’ve got at the moment.
There’s a problem with PHP version. PHP should be at least 5.3, some functions of the plugin don’t work with 5.2.17. We’ve added an information message about PHP version in a recent release.
To update PHP go to: http://php-osx.liip.ch/
NOTE: Users do not need to install PDFTK with the PRO version of the plugin.
Unfortunately I don’t think this is the solution. I’m running PHP 5.6
Formatting options and the select-box of PDF fields are only available when using the PRO version of the plugin or the free version with PDFtk through our server. Running PDFtk on your server will only provide a text field which requires you to enter the field ID as it appears in the uploaded PDF.
Indeed, the executable is installed here: /usr/local/bin/ so for MAMP and creating a symbolic link via
sudo ln -s /usr/local/bin/pdftk /usr/bin/pdftk
may be necessary.
While we are happy to continue providing standard support to install PDFtk and PRO2PDF on Linux, we are unable to provide any support for the Mac OSX – as it’s always missing a byte.
PDFtk development team only explains how to install the plugin on Linux here… http://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/
——————————————————
WordPress Form to PDF Form with One Simple Shortcode
——————————————————
Let us know if you’re still stuck on the install.
The issue with this user in this video https://www.youtube.com/watch?v=PwrEOvj9bSo&feature=youtu.be was that he needed to enter one dataset into the Formidable Form before the plugin would provide the select-box of PDF fields. Once he entered data into the form, the elect-box of PDF fields was populated.