• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

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;
0
jristov
Asked:
jristov
  • 2
1 Solution
 
mohan_sekarCommented:
May be, the PDF you are trying to fill is not longer fillable? Is it a government form? W4?
0
 
jristovAuthor Commented:
No, it's fillable all right, I have verified that. It is the 1040-V IRS payment voucher.
0
 
mohan_sekarCommented:
It has reader right enabled, by default. Download the form, create a copy by selecting File -> Save a copy. Then open the form in acrobat to verify whether you are using the 'correct' field names. I field names on the form are different from what you using in your program, I guess.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now