I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-01-14 16:46:05-08 by andhan
AcroForm
I've been looking around and it seems no Perl Lib is able to create AcroForm, ie a PDF document with fields that are user editable prior print.
This is much needed for creating agreement document where the user may fill in aditional data or change data that is not correct in the PDF.
I've written a module PDF::API2::AcroForm for this purpose, which I will submit here as soon it's stable.
If anyone has seen similar functionality already in PDF::API2, please let me know.

Best regards, Andreas Hansson
Direct Responses: 9730 | Write a response
Posted on 2009-01-14 18:38:47-08 by mikeg in response to 9729
Re: AcroForm
Hi Andreas,

I have been looking for exactly that, but to modify fields as opposed to reading them, to auto-fill some PDFs with information from a database. I'd love to see any code if you'd be willing to share, even if it's it not quite stable yet.

Is there a place you could upload it while it's under development? It sounds like it'll be a great addition to CPAN.

Cheers,
Mike Gillis
Direct Responses: 9735 | Write a response
Posted on 2009-01-15 07:36:46-08 by andhan in response to 9730
Re: AcroForm
Hi Mike.

My current version 0.04 is available here: http://81.236.138.45/perl/

To implement a method to change the default value of an already existing field you would need to change the text in more than one place in the PDF structure. First place to change would be the DV value of an Annotation object. This would do it for Acrobat Reader unless the PDF is damaged, but Foxit Reader would still show the old Default Value. This is because an editable field is presentated in two different objects. One that is the actually field, and one that is formatted just like all other text in the document. So the idea is probably that if the reader is too old to show the editable field, it will at least show the Default Value as text.

PDF::Reuse has a different approach for changing the Default Value. They use Javascript to - after the document is fully loaded - modify the value in each Edit Field. Not sure if that works with all readers or not.


//Andreas
Direct Responses: 9741 | 10669 | Write a response
Posted on 2009-01-15 15:40:08-08 by mikeg in response to 9735
Re: AcroForm
Andreas,

Thanks very much for uploading that, and the notes too. The PDF structure and specification is a bit difficult to understand at first, but seeing some code is a big help. I think I should be able to figure it out from here.

Cheers,
Mike
Direct Responses: Write a response
Posted on 2009-05-10 13:21:37-07 by gkupps in response to 9735
Re: AcroForm
Andreas, Thanks for your module. With this module, can we add javascript to the PDF form? Ganesh
Direct Responses: 10672 | Write a response
Posted on 2009-05-11 09:09:26-07 by andhan in response to 10669
Re: AcroForm
No, the Acroform module for PDF::API2 does not use Javascript. It's for sure possible to add it with PDF::API2 with some trial and error, but PDF::Reuse have documentation for how to add it here: http://search.cpan.org/~larslund/PDF-Reuse-Tutorial-0.11/Tutorial.pm#JavaScript:
Direct Responses: 10674 | Write a response
Posted on 2009-05-11 12:45:29-07 by gkupps in response to 10672
Re: AcroForm
Andreas, I used scribus and am able to create a PDF with form and javascript. But I have a general PDF question. How would i handle the response.. Is there an way to display the new PDF returned from the server similar to a browser? In Acrobat after i submit a form, the PDF response is opened in a new acrobat window, leaving the initial form open as well. I would like the response to just step on the form, like it does in browsers. Scribus link.. http://wiki.scribus.net/index.php/Your_first_PDF_form_with_Scribus Thanks again Ganesh
Direct Responses: 10680 | Write a response
Posted on 2009-05-12 10:26:28-07 by andhan in response to 10674
Re: AcroForm
Hi.
I don't know methods of handeling the submit of a PDF form. I use PDF forms to fill in and then print.
Direct Responses: Write a response