OK, I've upgraded to php 4.3.2 and have the FDF toolkit installed along with jdk, or whatever they are calling it these days.
I'm trying to send populating a PDF form I've created that has two fields, NAME and EMAIL. My script looks like this:
<?
$name = "Ben Sledge";
$email = "sledge@cubis.net";
$outfdf = fdf_create();
fdf_set_value($outfdf, "name", $name, 0);
fdf_set_value($outfdf, "email", $email, 0);
fdf_set_file($outfdf, "http://bsledge.equestrian.org/dev/testPDF.pdf");
fdf_save($outfdf, "outTest.fdf");
fdf_close($outfdf);
Header("Content-type: application/vnd.fdf");
Header("Content-Disposition: inline");
$fp = fopen("outTest.fdf", "r");
fpassthru($fp);
fclose($fp);
unlink("outTest.fdf");
?>
Now, I'm supposed to get the PDF opening automatically with the variables filled in, but instead, this is what I get on my screen:
%FDF-1.2 %âãÏÓ 1 0 obj << /FDF << /Fields 2 0 R /F ([url]http://bsledge.equestrian.org/dev/testPDF.pdf[/url])>> >> endobj 2 0 obj [ << /T (name)/V (Ben Sledge)>> << /T (email)/V (sledge@cubit.net)>> ] endobj trailer << /Root 1 0 R >> %%EOF
Which are the contents of the FDF file. Now, if I REMOVE the last two lines from the code above (the fclose and unlink), and therefore don't delete the FDF file, if I go and double click on that file in windows explorer, it will open up the PDF in Acrobat with the variables filled in. Just like it is suppose to. My question is, why isn't it opening up automatically in the browser? Why am I seeing the code of the FDF file?
I'm running php 4.3.2 on Windows XP for testing, it will be running on NT for development.
Thanks,
Sledge