Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks!
I have this PDF file that I am sending to users to verify theirs information. I can pre-fill their info from a database no problem, but my question is if anyone here has worked on something like this that would allow the user to edit the information on this PDF form if they want to update something there and email it back to me, because, once I open this pdf it doesn't allow me to edit the information. I know its an Adobe thing but I am wondering is there is a way around that other than present a HTML version of the PDF to the user. I am trying to do all from the PDF form I sent out. Here is a code sample I use to serve the PDF to the user pre-filled. I am also getting this error:
Unknown resource key 'Encoding' in form field dictionary at...
I cant figured it out way since all the fields on the form has been declared in %fields, any suggestion on that as well will be very appreciated.
Here is the code:

use strict; use warnings; use CAM::PDF; my $infile = 'acc.pdf'; #template my $outfile = 'acc_new.pdf'; # new filled up pdf to serve to the user. my $pdf = CAM::PDF->new($infile) or die 'error'; my @FIELDS = $pdf->getFormFieldList(); my %fields = ( 'name' => 'Joe test', 'address' => '100 Main Street', 'account_number' => '000007', 'date' => '05/19/2011', 'place' => 'USA', ); foreach my $field ( @FIELDS ) { $pdf->fillFormFields(%fields); $pdf->fillFormFields($field => $field); #sets the value of th +e field to the field name. } close(DATA); $pdf->cleanoutput($outfile);


Thanks for looking!

Replies are listed 'Best First'.
Re: Saving or emailing a filled PDF form Help!
by wind (Priest) on May 19, 2011 at 17:27 UTC
      Not even one about this:
      Unknown resource key 'Encoding' in form field dictionary at...
      I know the question about saving a PDF would be hard, the other postings doesn't say anything about saving, creating or writing to but allowing editing after the PDF has been created, unfortunately its hard.
Re: Saving or emailing a filled PDF form Help!
by LanX (Saint) on May 19, 2011 at 16:56 UTC
    IIRC we already had this question, did you search the archives?

    Cheers Rolf

    UPDATE: indeed it's in the archives and thanx for downvoting ... :-P

      Can you post link to archive doc?
      I can't find.

      Regards,
      sl7020

        Sorry no idea what I found 5.5 years ago.

        You might try javascript in acrobat reader (only?!?), but that's really off topic here.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!