Convert .fdf to .pdf

Posted on 16th Feb 2014 by admin

I currently have a web form that uploads the form data to an .fdf file and emails it.

However, I just realized that most people I email it to cannot open an .fdf and it needs to be in pdf.

Is there any way to convert an fdf file to pdf using php??


Here is my code which currently creates the .fdf:Code: function createFDF($file,$info){
$data="%FDF-1.2n%âãÏÓn1 0 objn<< n/FDF << /Fields [ ";
foreach($info as $field => $val){
if(is_array($val)){
$data.='<</T('.$field.')/V[';
foreach($val as $opt)
$data.='('.trim($opt).')';
$data.=']>>';
}else{
$data.='<</T('.$field.')/V('.trim($val).')>>';
}
}
$data.="] n/F (".$file.") /ID [ <".md5(time()).">n] >>".
" n>> nendobjntrailern".
"<<n/Root 1 0 R nn>>n%%EOFn";
return $data;
}

Other forums