Skip to content

Create real PDF signature fields#167

Merged
nonprofittechy merged 1 commit into
mainfrom
codex/real-signature-fields
Jun 5, 2026
Merged

Create real PDF signature fields#167
nonprofittechy merged 1 commit into
mainfrom
codex/real-signature-fields

Conversation

@nonprofittechy

@nonprofittechy nonprofittechy commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

Fixes FormFyxer PDF export so FieldType.SIGNATURE fields are emitted as real AcroForm signature fields (/FT /Sig) instead of text fields.

Also declares the uv dev dependency group expected by the shared SuffolkLITLab/ALActions/pythontests workflow so CI can install mypy, pytest, and FormFyxer runtime imports before running checks.

Root cause

ReportLab does not expose a signature widget API, so FormFyxer created signature placeholders with form.textfield(). That preserved placement, but external PDF editors correctly interpreted the result as a text field.

The CI failure happened because the shared action runs uv sync --group dev when [dependency-groups] exists and then calls uv run mypy; FormFyxer did not previously declare uv-managed dev dependencies.

Changes

  • Normalize generated signature placeholders in the temporary field PDF before copying fields into the destination PDF.
  • Set AcroForm /SigFlags when signature fields are created.
  • Preserve signature width/height when existing PDF fields are read back into FormField objects.
  • Add an end-to-end regression test that writes a PDF with both signature and text fields, then verifies the raw PDF field types.
  • Add a dev dependency group for the shared uv-based CI action.

Validation

  • uv sync --group dev
  • export PYTHONPATH=$PYTHONPATH:$PWD; uv run mypy . --exclude '^build/' --explicit-package-bases
  • uv tool run bandit -r . --exclude './scripts,./venv,./.venv,./build' --severity-level=high
  • export PYTHONPATH=$PYTHONPATH:$PWD; uv run pytest -q
  • python -m py_compile formfyxer/pdf_wrangling.py formfyxer/tests/test_pdf_labeling_rules.py
  • git diff --check

GitHub Actions passed on commit 0afd913.

@nonprofittechy nonprofittechy force-pushed the codex/real-signature-fields branch from 15108fa to 0afd913 Compare June 5, 2026 20:51
@nonprofittechy nonprofittechy changed the title [codex] Create real PDF signature fields Create real PDF signature fields Jun 5, 2026
@nonprofittechy nonprofittechy marked this pull request as ready for review June 5, 2026 20:54
@nonprofittechy nonprofittechy merged commit d1082e2 into main Jun 5, 2026
2 checks passed
@nonprofittechy nonprofittechy deleted the codex/real-signature-fields branch June 5, 2026 20:55
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