Another form improvement to make more PDF forms usable with Free Software :-)
A real world example is a german tax form, which uses two hide actioins for the user to confirm that a notice was read. Confirming through the button click hides the notice and opens up editing of the fields below the buttons: Veraeusserungsanzeige.pdf
Visibility changes can be done either through JavaScript or through a Hide Action.
I've created an example containing both:
Here is how it looks in Adobe:
And here is how it looks in Okular after the Differantials I will now
attach:
As you can see hiding through actions only works for the first element. This is because Poppler does not parse action chains (Next Actions). Next actions allow for multiple actions executed in a row, which is used in the example documents.
I'll look into parsing / handling the Next Actions, but IMO this patchset is already a nice improvement and can be reviewed as is.
To avoid code duplication in Okular I did not create a new Okular::HideAction but instead used a JavaScript action to implement it.
This reuses the updateField / refreshFormWidget infrastructure.