can't assign variable name to filename in pdftk

338 views Asked by At

I am trying to run the following command in a php script and for some reason it doesn't work, and i don't get any errors either:

shell_exec("pdftk Invoice.pdf fill_form invoice.fdf output" . $_POST["Job"] . ".pdf flatten");

But if i run the same command but actually give it a filename it works fine

shell_exec("pdftk Invoice.pdf fill_form invoice.fdf output testing.pdf flatten");
1

There are 1 answers

0
Jessica On

You need a space after output (within your string). If you echo your actual string you're generating there it's not going to read output testing.pdf, but outputtesting.pdf