mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 03:32:14 +10:00
This change flattens and normalizes annotation and widget layers within the PDF document removing items that can be accidentally modified after signing which would void the signature attached to the document. Initially this change was just to assign to an ArcoForm object in the document catalog if it existed but quickly turned into the above. When annotations aren't flattened Adobe PDF will say that the signature needs to be validated and upon doing so will become invalid due to the annotation layers being touched. To resolve this I set out to flatten and remove the annotations by pulling out their normal appearances if they are present, converting them into xobjects and then drawing those using the drawObject operator. This resolves a critical issue the users experienced during the signing flow when they had marked up a document using annotations in pdf editors.