Hi
I'm trying to send data to a PDF document using FDF, here's my code:
<?
$url="http://www.website.co.uk/admin/endorsements/endorsement_combined.pdf";
//$values=$HTTP_POST_VARS;
$fdfdata = "%FDF-1.2\n%????\n";
$fdfdata .= "1 0 obj \n<< /FDF ";
$fdfdata .= "<< /Fields [\n";
$company_id=106503;
$company_name="Blossom Hill";
$address="64 Hillside Road";
$fdfdata.="<< /V ($company_id)/T (<<company_id>>)>>";
$fdfdata.="<< /V ($company_name)/T (<<company_name>>)>>";
$fdfdata.="<< /V ($address)/T (<<address>>)>>";
$fdfdata .= "]\n";
$fdfdata .= "/F ($url) >>";
$fdfdata .= ">>\nendobj\ntrailer\n<<\n/Root 1 0 R\n>>\n";
$fdfdata .= "%%EOF";
/ Now we display the FDF data which causes Acrobat to start /
header ("Content-Type: application/vnd.fdf");
print $fdfdata;
?>
When I access this file, it just prints the FDF file in the browser instead of opening the pdf document: http://www.website.co.uk/admin/endorsements/endorsement_combined.pdf
Does anyone know where I'm going wrong? I'm still new to this so any help would be appreciated in the most layman terms.
Once I have the above working, the idea is to call some data from a db, and insert it into a PDF, I've stored a link to an image on the server that I'd also like inserted into the PDF, so any ideas on how I could acheive this would be gratefully appreciated.
Thanks a million
Lulubell