Skip to content

Restore accessible AcroForm options and explicit field font sizes - #1805

Merged
blikblum merged 4 commits into
foliojs:masterfrom
tevinch:accessible-form-fields
Oct 18, 2026
Merged

blikblum merged 4 commits into
foliojs:masterfrom
tevinch:accessible-form-fields

Conversation

@tevinch

@tevinch tevinch commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Fixes #1803. Tagged form widgets can now receive alternateName (/TU) and structParent through the public form methods. An explicitly supplied fontSize also applies when the field uses the default form font; omitting it preserves inherited appearance behavior.

The structure reference captures the widget's page when it is created. Otherwise, adding a later page before finalizing the structure writes an OBJR pointing to that later page. Tests cover this delayed finalization together with nested field membership, distinct structure parents, Unicode/empty names, and explicit zero sizing.

Validation

  • yarn test --maxWorkers=4: 61 files, 536 tests passed. The unrestricted run timed out in four visual tests; the four-worker run kept the existing 8-second timeout.
  • yarn lint, yarn build, yarn test:package, and formatting checks passed.
  • A two-page generated form passed veraPDF 1.30.2's ua1 profile: 106 rules and 593 checks, zero failures. The same local workflow passed through a CommonJS esbuild bundle with registered standard-font metrics.
  • Two programmatic fill/save/reopen cycles preserved values, both pages, original text, metadata and widget/structure references. This does not establish PDF/UA conformance after editing: the pypdf appearance-generation probe failed separate font validation. No AWS deployment or human screen-reader test was performed.

Reproduction, source patch, sample PDF and detailed validation limits.

Checklist

  • Unit Tests
  • Documentation
  • Update CHANGELOG.md
  • Ready to be merged after review

@blikblum

Copy link
Copy Markdown
Member

Please resolve the conflicts

@tevinch

tevinch commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the changelog conflict by merging master at e2fafd2. The original form and structure changes and their regression tests are unchanged.

Revalidated on Node 24.19.0:

  • 62 test files, 562 tests passed with two workers and the existing 8-second timeout.
  • Lint, formatting, build, and CommonJS/ESM package-resolution checks passed.
  • The two-page sample passed veraPDF's PDF/UA-1 profile: 106 rules and 593 checks. Two programmatic fill/save/reopen cycles preserved field values, both pages, original text, and widget/structure links.

The previously documented post-edit font conformance limits still apply.

@blikblum

Copy link
Copy Markdown
Member

Sorry it ended to conflicting again.

I tried to resolve conflict myself but i could not (seems you unchecked the option to allow maintainer to update the PR)

Feel free, to either resolve the conflict again or let me update the repository directly (in later case you loose automatic github attribution)

@tevinch

tevinch commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the conflict again in c361d60 by merging master at 50af0aa. The form/structure source and regression tests are unchanged. The changelog entry now sits at the end of Unreleased, which also avoids the same overlap when a new entry is prepended.

Lint, formatting, build and package-entry checks passed. The regenerated two-page sample passed veraPDF's PDF/UA-1 profile (106 rules, 593 checks), and two programmatic fill/save/reopen cycles preserved its values and structure links. The previously documented post-edit font limitations still apply.

The full local suite is not green: 561/565 tests passed, with four visual tests hitting their existing 8-second timeout (columns_simple, lists, tables, toc). tables also timed out with the current upstream runtime files; I have not independently established the cause of the other three timeouts. No test timeout or snapshot was changed.

@blikblum
blikblum merged commit f973e25 into foliojs:master Oct 18, 2026
3 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.

Form annotations: TU has no mapping and structParent is dropped, so form fields cannot be made PDF/UA compliant

2 participants