Guys.. anybody working with pdf creation using php? I have a pdf form and
what I need is to pass variables to it (I already did this and it creates
the .fdf file and outputs to the browsers, acrobat opens up and shows the
form populated) but how can I also save the resulting .pdf file on the
server?

I know that you need to have full acrobat to be able to save the populated
form on disk, free readers will save the blank form so what I would like to
do is after submitting the form, just before acrobat open and showsw the
filled form, be able to save on the servers a copy of the populated PDF
file.

Im not using any fdf library or anything, just this code and works great so
far:

<?php
// Uses names and values from a post method

$url="http://www.intruder.com.mx/temp/pdf/form.pdf";;

$values=$HTTP_GET_VARS;

$fdfdata = "%FDF-1.2\n%âãÏÓ\n";
$fdfdata .= "1 0 obj \n<< /FDF ";
$fdfdata .= "<< /Fields [\n"; 

//loop that adds the field names and values
foreach($values as $key=>$val)
        {
        $fdfdata.="<< /V ($val)/T ($key) >> ";
        }

        
$fdfdata .= "]\n";
$fdfdata .= "/F ($url) >>";
$fdfdata .= ">>\nendobj\ntrailer\n<<\n/Root 1 0 R\n>>\n";
$fdfdata .= "%%EOF";

//uncomment if you actually want to write a FDF file
//touch ($form.".fdf");
//$FD = fopen ($form.".fdf", "w");
//fwrite($FD,$fdfdata);
//fclose ($FD);

/*** Now we display the FDF data which causes Acrobat to start  ***/

header ("Content-Type: application/vnd.fdf");
print $fdfdata;
?>

Any ideas?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to