Posted on 2010-02-06 08:32:02.371765-08 by jdmccullough
Problem when I use a field name more than once on a PDF
I have a simple PDF (created with Acrobat 9) that has the field 'EmployeeNumber' in it twice. When I try to populate the fields using fillpdffields.pl, it doesn't work correctly. When I view the populated PDF, the 'EmployeeNumber' fields appear to be un-populated however, when I click in the fields, the value is shown. When I click out of the fields, the value goes away though. Does anyone know why this is happening? Is there a workaround? Should you be able to use a field name more than once?
Here's my code:
#!/usr/bin/perl use CAM::PDF; my $infile = "test1.pdf"; my $outfile = "out1.pdf"; my $doc = CAM::PDF->new($infile) || die "$CAM::PDF::errstr\n"; my @populateList = (EmployeeNumber, 60814); $doc->fillFormFields(@populateList); $doc->cleanoutput($outfile);

Thanks.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.