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,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.
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,