MatthiasValvekens / pyHanko

pyHanko: sign and stamp PDF files
MIT License
483 stars 71 forks source link

Improve ad-hoc field creation UX in CLI #273

Closed MatthiasValvekens closed 1 year ago

MatthiasValvekens commented 1 year ago

Description of the changes

When creating fields together with a signature, the CLI currently does not always do the "obvious" thing. In particular, certain combinations of parameters that don't really make sense are still processed with sometimes counterintuitive results. This PR adds error handling and more informative failure messages for such cases. It also adds a point of clarification to the documentation regarding the --field argument to addsig in the CLI usage guide.

See #272 for the question that prompted this change. (CC: @regonzalom)

Checklist

Please go over this checklist to increase the chances of your PR being worked on in a timely manner. Deviations are allowed with proper justification (see previous section).

For new features (delete if not applicable)

For documentation contributions (delete if not applicable)