Skip to content

sign: sign an existing signature field by name - #181

Open
yuliiaandreieva-ol wants to merge 1 commit into
digitorus:mainfrom
yuliiaandreieva-ol:sign-existing-field
Open

yuliiaandreieva-ol wants to merge 1 commit into
digitorus:mainfrom
yuliiaandreieva-ol:sign-existing-field

Conversation

@yuliiaandreieva-ol

Copy link
Copy Markdown

Signing always adds a new signature field. Documents prepared by a form editor or a web viewer often already have an empty signature field for the signer, and there is no way to put the signature into it.

This adds SignData.FieldName and SignBuilder.Field(name), the fully qualified name of an existing, unsigned signature field:

  • the field is found with the internal/acroform walk, so nested names and an inherited /FT work;
  • the field dictionary is rewritten in the incremental update with its entries kept and /V added; its widgets are already in the page /Annots, so the page and /AcroForm /Fields are not touched;
  • an unknown name, a non-signature field, a field with child fields, an already signed field, a direct-object field and a visible Appearance are rejected;
  • an empty FieldName keeps the current behaviour.

Tests: a new fixture testfile_signature_fields.pdf (merged field/widget, nested field with a separate widget, text field), sign-package tests including the previous revision being kept byte for byte and two fields signed in turn, and a fluent API test. Outside the suite, outputs, including a PDF whose field was created by Nutrient Web SDK, validate as PAdES-BASELINE-B / TOTAL_PASSED in EU DSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant