Skip to content

fix(signatures): fit visible signature text and center watermark - #607

Merged
bzsanti merged 8 commits into
developfrom
fix/issue-606-signature-layout
Sep 20, 2026
Merged

bzsanti merged 8 commits into
developfrom
fix/issue-606-signature-layout

Conversation

@bzsanti

@bzsanti bzsanti commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

Visible signature logos reserved a separate column, and long text was clipped or omitted. This change centers the watermark behind the text and fits every line within the rectangle, returning an explicit error when the complete text cannot fit at 6 points.

Refs #606. Targets develop; promotion to main follows after CI. The v5.1.3 release remains paused.

Changes

  • Add public SignatureAppearance::layout(rect) and use that same result during PDF generation.
  • Wrap text using Helvetica/WinAnsi metrics and fit width, height, margins and line spacing at 6–12 points.
  • Preserve watermark aspect ratio and opacity without reducing the text area.
  • Borrow static Helvetica metrics once, addressing the QR finding about per-character map clones.
  • Add seven regressions and verify that finalization preserves the appearance bytes signed by OpenSSL.
  • Record review results and the cancelled release state in the changelog and tracking documents.

Testing

  • 20 focused tests pass, including qpdf, OpenSSL and pdftoppm interoperability.
  • Library suite: 6,789 passed, 3 ignored; public layout doctest passes.
  • cargo clippy --locked -p oxidize-pdf --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • New behavior is covered by assertions on content, dimensions, error boundaries and signed bytes.
  • Kripteia: 92/100 across the four affected Rust files; new regression suite 100/100. Security reports no findings. The single manually confirmed QR finding is corrected and revalidated.
  • Full multiplatform CI will validate the PR.

Checklist

  • Targets develop.
  • CHANGELOG.md updated.
  • Existing public signatures preserved; the layout API is additive. Text that cannot fit now produces an error instead of silently losing content.

@bzsanti
bzsanti merged commit 7115fee into develop Sep 20, 2026
15 of 16 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.

1 participant