MatthiasValvekens / pyHanko

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

cli --no-strict-syntax missing #262

Closed jtplaarj closed 1 year ago

jtplaarj commented 1 year ago

Describe the bug

Option --no-strict-syntax does not exist.

To Reproduce

pyhanko  sign addfields --no-strict-syntax --field 1/0,0,100,200/test test_in.pdf test_out.pdf
Usage: pyhanko sign addfields [OPTIONS] INFILE OUTFILE
Try 'pyhanko sign addfields --help' for help.

Error: No such option: --no-strict-syntax

Expected behavior

According to the documentation option --no-strict-syntax should exist. In fact, the command is recommended by the cli due to a problem in the PDF:

2023-05-23 12:09:55,676 - cli - ERROR - Failed to read PDF file in strict mode; rerun with --no-strict-syntax to try again.
Error message: Object with id 273 has an orphaned generation: generation 1 was not preceded by a free instruction for generation 0.
Error: Failed to read PDF file in strict mode; rerun with --no-strict-syntax to try again.
Error message: Object with id 273 has an orphaned generation: generation 1 was not preceded by a free instruction for generation 0.

Environment (please complete the following information):

MatthiasValvekens commented 1 year ago

Looks like it's not registered on the addfields subcommand (only on addsig/validate). Will take a look. Thanks!

MatthiasValvekens commented 1 year ago

I have a fix pending that makes all non-cryptographic CLI commands implicitly use nonstrict mode (see linked PR). addfields is one of those, so your case should be covered :).