tcocca / active_pdftk

ruby wrapper for the pdftk command line utility for working with editable pdf files
MIT License
46 stars 37 forks source link

Read only fields filling #33

Open cryo28 opened 12 years ago

cryo28 commented 12 years ago

Our project prepopulates a few pdf forms taken from 3rd-parties by the means of ActivePdftk. In some of such forms there are a few "readonly" fields which we nevertheless need to be populated. However, this cannot be done with ActivePdfktk without patching it, because it silently ignores all attempts to set a value to readonly field

https://github.com/tcocca/active_pdftk/blob/master/lib/active_pdftk/field.rb#L224 https://github.com/tcocca/active_pdftk/blob/master/lib/active_pdftk/form.rb#L87

PDFTK is fine filling readonly fields on its own.

It would be great if ActivePdftk would allow to populate readonly fields.

I'd be happy to come up with a pull requests. I'd like to discuss whether read_only? check can be removed from the mentioned above lines of code or should the code contain some different methods instead of set and value= to assign values for read only fields?

tcocca commented 12 years ago

Hi,

I think if we are going to have ActivePdftk fill out form fields that are #read_only? there needs to be some type of explicit call that sets read_only fields. I don't want it to be the default action as I think it will confuse more people.

If you can come up with something for the api to explicitly set values for read_only I will definitely check it out.

~ Tom