Acrobat bug ? why add annnot save , signature verified "the byte range is invalid"

Copy link to clipboard
Copied
In the attached file, after adding an annotation with Acrobat, the last signature is verified as valid. However, after saving and reopening, it shows that the byte range is invalid.
Copy link to clipboard
Copied
Hi there
Hope you are doing well.
As described you’re encountering an issue where adding an annotation in Acrobat causes a previously valid signature to show a "byte range is invalid" error after saving and reopening the file. This typically occurs because adding annotations modifies the document, which can alter its structure and affect the integrity of the digital signature.
When a document is signed, the signature applies to the exact byte range of the file at the time of signing. Any modification, including adding annotations, changes the byte range, which invalidates the signature.
To avoid this:
- Ensure all edits, including annotations, are completed before signing the document.
- Once signed, avoid making further changes to the file.
Amal
Copy link to clipboard
Copied
See this answer to your duplicate question: The revision with the troublesome signature contains errors: The Length entries of all streams are incorrect.
When validating the file as is, with the troublesome signature covering the whole file, Acrobat essentially only checks the signed hash value when checking for file changes, and so can succeed.
But when validatingf the file with additional incremental updates, Acrobat applies additional checks when checking for file changes, and these checks are very sensitive to structural PDF errors.
You ask "Acrobat bug?" - the actual bug is that Acrobat (and virtually every other PDF viewer) don't immediately reject test.pdf or at least warn their users that test.pdf has multiple structural errors which may result in any kind of later misbehavior.

