jristov
asked on
Problems using FDF format to display variable PHP form data--was there a recent change?
I have been using the FDF format to display variable data on select PDF tax forms for some time now. (See PHP code below.) However, something appears to have changed with the latest 2009 forms; no data is showing, even though I am using the right identifiers for the form fields. (such as f1_07_0_[0]). Or, maybe it's something in my recently updated IE8 browser.
Any ideas what could be wrong? Need this ASAP.
$url = urlhead() . "pdfs/f1040v.pdf";
$fdfdata = "%FDF-1.2\n%’“&& Mac178;\n" ;
$fdfdata .= "1 0 obj \n<< /FDF ";
$fdfdata .= "<< /Fields [\n";
$s1 = "";
$s2 = "";
$s3 = "";
$s1 = substr($ret['ssn'],0,3);
$s2 = substr($ret['ssn'],3,2);
$s3 = substr($ret['ssn'],5,4);
$fdfdata .= "<< /V (" . $s1 . ")/T (f1_04_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s2 . ")/T (f1_04_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s3 . ")/T (f1_04_0_[0]) >> ";
$s1 = substr($ret['sp_ssn'],0,3) ;
$s2 = substr($ret['sp_ssn'],3,2) ;
$s3 = substr($ret['sp_ssn'],5,4) ;
if ($ret['fs'] == 2) {
$fdfdata .= "<< /V (" . $s1 . ")/T (f1_07_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s2 . ")/T (f1_07_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s3 . ")/T (f1_07_0_[0]) >> ";
}
if ($int['init']) $int['fname'] .= " " . $int['init'];
if ($int['sp_init']) $int['sp_fname'] .= " " . $int['sp_init'];
$fdfdata .= "<< /V (" . $int['fname'] . ")/T (f1_08_0_[0]) >> ";
$fdfdata .= "<< /V (" . $int['lname'] . ")/T (f1_09_0_[0]) >> ";
if ($ret['fs'] == 2) {
$fdfdata .= "<< /V (" . $int['sp_fname'] . ")/T (f1_10_0_[0]) >> ";
$fdfdata .= "<< /V (" . $int['sp_lname'] . ")/T (f1_11_0_[0]) >> ";
}
$ret['city'] .= " " . $ret['state'] . " " . $ret['zip'];
$fdfdata .= "<< /V (" . $ret['address'] . ")/T (f1_01_0_[0]) >> ";
$fdfdata .= "<< /V (retcity)/T (f1_15_0_[0]) >> ";
I have been using the FDF format to display variable data on select PDF tax forms for some time now. (See PHP code below.) However, something appears to have changed with the latest 2009 forms; no data is showing, even though I am using the right
$fdfdata .= "]\n";
$fdfdata .= "/F ($url) >>";
$fdfdata .= ">>\nendobj\ntrailer\n<<\n /Root 1 0 R\n>>\n";
$fdfdata .= "%%EOF";
header ("Content-Type: application/vnd.fdf");
echo $fdfdata;
Any ideas what could be wrong? Need this ASAP.
$url = urlhead() . "pdfs/f1040v.pdf";
$fdfdata = "%FDF-1.2\n%’“&&
$fdfdata .= "1 0 obj \n<< /FDF ";
$fdfdata .= "<< /Fields [\n";
$s1 = "";
$s2 = "";
$s3 = "";
$s1 = substr($ret['ssn'],0,3);
$s2 = substr($ret['ssn'],3,2);
$s3 = substr($ret['ssn'],5,4);
$fdfdata .= "<< /V (" . $s1 . ")/T (f1_04_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s2 . ")/T (f1_04_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s3 . ")/T (f1_04_0_[0]) >> ";
$s1 = substr($ret['sp_ssn'],0,3)
$s2 = substr($ret['sp_ssn'],3,2)
$s3 = substr($ret['sp_ssn'],5,4)
if ($ret['fs'] == 2) {
$fdfdata .= "<< /V (" . $s1 . ")/T (f1_07_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s2 . ")/T (f1_07_0_[0]) >> ";
//$fdfdata .= "<< /V (" . $s3 . ")/T (f1_07_0_[0]) >> ";
}
if ($int['init']) $int['fname'] .= " " . $int['init'];
if ($int['sp_init']) $int['sp_fname'] .= " " . $int['sp_init'];
$fdfdata .= "<< /V (" . $int['fname'] . ")/T (f1_08_0_[0]) >> ";
$fdfdata .= "<< /V (" . $int['lname'] . ")/T (f1_09_0_[0]) >> ";
if ($ret['fs'] == 2) {
$fdfdata .= "<< /V (" . $int['sp_fname'] . ")/T (f1_10_0_[0]) >> ";
$fdfdata .= "<< /V (" . $int['sp_lname'] . ")/T (f1_11_0_[0]) >> ";
}
$ret['city'] .= " " . $ret['state'] . " " . $ret['zip'];
$fdfdata .= "<< /V (" . $ret['address'] . ")/T (f1_01_0_[0]) >> ";
$fdfdata .= "<< /V (retcity)/T (f1_15_0_[0]) >> ";
I have been using the FDF format to display variable data on select PDF tax forms for some time now. (See PHP code below.) However, something appears to have changed with the latest 2009 forms; no data is showing, even though I am using the right
$fdfdata .= "]\n";
$fdfdata .= "/F ($url) >>";
$fdfdata .= ">>\nendobj\ntrailer\n<<\n
$fdfdata .= "%%EOF";
header ("Content-Type: application/vnd.fdf");
echo $fdfdata;
May be, the PDF you are trying to fill is not longer fillable? Is it a government form? W4?
ASKER
No, it's fillable all right, I have verified that. It is the 1040-V IRS payment voucher.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.