[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problems using FDF format to display variable PHP form data--was there a recent change?

Posted on 2009-12-30
4
Medium Priority
?
418 Views
Last Modified: 2012-05-08
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
Comment
Question by:jristov
  • 2
3 Comments
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 26294147
May be, the PDF you are trying to fill is not longer fillable? Is it a government form? W4?
0
 

Author Comment

by:jristov
ID: 26294356
No, it's fillable all right, I have verified that. It is the 1040-V IRS payment voucher.
0
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 2000 total points
ID: 26294500
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question