Why isn't the pdftk-php class finding the pdftk.exe path?

I’m currently trying to get the example that I downloaded with pdftk-php from GitHub to work by using the instructions from the following web page:

The database connection seems fine, but the pdf that gets produced only has a size of one kilobyte and Adobe Reader can’t open it.
I’m assuming the problem must be in the pdftk-php.php file.
For the passthru function near line 71 I originally used the following absolute path to the pdftk:

passthru(“C:\Program Files (x86)\PDFtk\bin\pdftk.exe $pdf_original fill_form $fdf_fn output - flatten”);

This is exactly what I got from the command prompt when I typed “where pdftk”. Since this didn’t work I tried the following relative path:

passthru(“…\pdftk.exe $pdf_original fill_form $fdf_fn output - flatten”);

I was able to produce the form-fields.txt file just fine from the command prompt so I know pdftk is working, but I get an Undefined index error on line 47 of index.php when I submit the first and last name and the form that it produces can’t be opened by Adobe Reader.

You are using the wrong way to include file

If you use “\” you must use “\\” in string like this

passthru(“…\\pdftk.exe $pdf_original fill_form $fdf_fn output - flatten”);

But as I know, PHP function you need to use “/” so that you need to use like this, even in Windows or Linux

passthru(“…/pdftk.exe $pdf_original fill_form $fdf_fn output - flatten”);