Skip to content

feat: support existing PDF signature fields - #65

Merged
vitormattos merged 1 commit into
JSignPdf:mainfrom
vikas-kushwaha-dev:feat/62-signature-fields
Sep 17, 2026
Merged

vitormattos merged 1 commit into
JSignPdf:mainfrom
vikas-kushwaha-dev:feat/62-signature-fields

Conversation

@vikas-kushwaha-dev

Copy link
Copy Markdown
Contributor

Summary

Adds typed support for inspecting and selecting existing PDF signature fields using the JSignPdf 3.2 CLI capabilities.

  • Add immutable SignatureField model exposing field name, page, coordinates, signed/blank state, hidden state, and rectangle visibility
  • Add JSignService::getSignatureFields() and facade support for inspecting existing fields
  • Parse the documented --list-sig-fields output, including Unicode names, spaces, hidden fields, zero-size rectangles, and selector-shadow messages
  • Add JSignParam::setSignatureField() / getSignatureField() for selecting an existing field during signing
  • Pass field names directly to JSignPdf through --sig-field without implementing selector semantics in PHP
  • Preserve JSignPdf diagnostics for invalid, missing, or already-signed fields
  • Clean up temporary PDFs after successful and failed inspection
  • Add unit and integration coverage using real PDF signature fields
  • Document inspection and existing-field signing in the README

Testing

  • composer cs:check
  • composer test:unit
  • composer psalm
  • composer test:integration

All checks pass.

Closes #62

Signed-off-by: vikas-kushwaha-dev <vikaskushwaha.dev00@gmail.com>

@vitormattos vitormattos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I checked the implementation against #62, including the parser, signature field selection, error handling, temporary file cleanup and the integration tests.

The implementation follows the JSignPdf 3.2 behavior without adding PDF or selector logic in PHP, and the current CI is passing.

@vitormattos
vitormattos merged commit 2cd21fa into JSignPdf:main Sep 17, 2026
9 checks passed
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.

Add typed API for existing PDF signature fields

2 participants