I'm using CAM::PDF to generate a completed pdf form, following node:
Filling out PDF forms with data from DBI?
However to send it I want to remove the editable fields and convert it into a pdf document. Can anyone help me to do this, please?
#!/usr/bin/perl
# pdf-filler-test.pl
use strict;
use warnings;
use CAM::PDF;
#
my $infile = 'input.pdf';
my $outfile = 'output.pdf';
my $pdf = CAM::PDF->new($infile) or die 'wtf';
my @FIELDS = $pdf->getFormFieldList();
#
foreach ( @FIELDS ) {
my $fieldnum = $_;
$pdf->fillFormFields($_ => $fieldnum);
}
$pdf->cleanoutput($outfile);
Update: I used the following code to achieve this:
$pdf->clearAnnotations();
$pdf->cleanoutput($outfile);