in reply to Filling PDF Form Checkboxes
follwing code works for me though there is an error message "Unknown resource key 'Encoding' in form field dictionary at /usr/local/share/perl/5.26.1/CAM/PDF.pm line 2914."
#!/usr/bin/perl -w use strict; use CAM::PDF; my $pdf = CAM::PDF->new('tenant.pdf') or die "Could not open PD +F ($!)!"; my @fields = $pdf->getFormFieldList(); foreach my $field ( @fields ) { if ($field =~ /Female/) { my $ff_obj = $pdf->getFormField($field); $ff_obj->{value}->{value}->{AS}->{value} = "On"; } else { $pdf->fillFormFields($field => $field); } } $pdf->cleanoutput('afilled.pdf');
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Filling PDF Form Checkboxes
by Anonymous Monk on Aug 03, 2020 at 18:20 UTC | |
Re^2: Filling PDF Form Checkboxes
by Anonymous Monk on Jul 29, 2020 at 15:12 UTC |
In Section
Seekers of Perl Wisdom