Skip to content

Shrink a form field's text to fit its field instead of cutting it off (#433) - #441

Merged
jakejackson1 merged 2 commits into
feature/pdfa-2-conformancefrom
fix/433-shrink-field-text
Sep 23, 2026
Merged

jakejackson1 merged 2 commits into
feature/pdfa-2-conformancefrom
fix/433-shrink-field-text

Conversation

@jakejackson1

@jakejackson1 jakejackson1 commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Fixes #433

Some form field text used to be cut off when it was wider than its field. That applied to a text input's value, a combo box's choice and a push button's caption. That text is now drawn in a smaller font, both when it is drawn into the page and in an active field's appearance. Before, the page version cut text inputs to whole characters, and the active version clipped at the field's edge. This is always on. There is no config option.

The rule

One private method, Form::fitLine(), applies it to every field type and to both the static drawing and the active appearance. The caller passes a closure that measures the text, so the same rule works with shaped page text in mm and with appearance text in points.

  • Text that fits is drawn at the field's size.
  • Text that is too wide is drawn at a size scaled down by the ratio, rounded down to the 0.001pt precision Tf is written at.
  • The smallest size is half the field's size, and never below 6pt. A field already smaller than 6pt is not shrunk.
  • Past that minimum, characters are trimmed from the end. A binary search finds the longest start that fits, so long text is measured O(log n) times.

Static fields (useActiveForms off)

  • Text inputs, selects and buttons all draw through the new fittedCell(). It shapes the text, fits it to the room inside the padding, sets the fitted size around Cell() and then restores it. The field's box stays the same size, so the layout does not move.
  • Text inputs. The value is shaped with applyOTL() and magic_reverse_dir() before it is measured, as Cell() draws it. The old loop measured and trimmed the raw string, which added unshaped Arabic codepoints to the font subset and could leave a trimmed Arabic value ending in the wrong letter form. Each trimmed candidate is shaped again.
  • Buttons. The static button branch in print_ob_button() no longer shapes its caption inline. It goes through shapeText().
  • Selects. A select's choice is shaped when it is read, so its OTL data is cut with it (OtlData::slice()), not shaped a second time. The drop-down arrow keeps the field's size.
  • Padding units. form_element_spacing is in millimetres. The $k that print_ob_text() divides by is the table shrink factor (shrin_k), not Mpdf::SCALE, and it is 1 outside a shrunk table. The old loop subtracted the unshrunk padding while Cell() drew the shrunk padding, so in a table shrunk to fit the page, a value that fitted still lost a character. The room is now $w minus twice the padding Cell() is given.

Active fields

  • Text and password fields. An overflowing value is drawn smaller in the appearance, and /DA is written with 0 Tf so the viewer auto-sizes it too. Without that, the text jumps back to full size when the field is focused.
  • Combo boxes (select without multiple and without a size of 2 or more). Same as text fields, including /DA … 0 Tf when shrunk. Auto size applies to any variable-text field, choice fields included (ISO 32000 12.7.3.3). Acrobat offers "Auto" font size for drop-downs, and pdf.js computes a size for choice widgets whose /DA size is 0. So once a user picks another option, the viewer fits that option as well. A combo box that fits keeps its fixed size. List boxes are unchanged.
  • Push buttons (submit, reset, button). /DA names the size the appearance was drawn at, fitted or not. A button has no editable text: a viewer only redraws it from /MK /CA and /DA, for example for the rollover (/RC) or down (/AC) caption. A fixed size matching our appearance keeps that redraw looking the same. 0 Tf would let each viewer choose its own size for a caption the user can never change.
  • Past the minimum, the appearance is trimmed to whole characters, as the static drawing is, instead of clipped mid-glyph. It uses the same fitLine() binary search, measuring with emWidth(). /V and /DV (text), /Opt (combo) and /CA (button) keep the whole text.
  • Not fitted:
    • Hidden inputs. They have no room.
    • Image buttons, which draw an icon and no caption. Their /DA keeps the field's size. To make this possible, SetJSButton() now registers the icon before it calls SetFormButton().
  • Widths differ from static. The active and static sizes of the same field are not identical. The appearance keeps the 3pt padding from Give every active form widget its own appearance, and ask the viewer to redraw only text it cannot shape (#348, #59) #387 (border + 2pt), and an active text widget is 2.4mm wider than the static field's text area.

In practice, selects and buttons that come from HTML are sized to their own text by Tag\Select and Tag\Input, so they rarely overflow. One case where they can is an active button with an empty value, which shows its name. The rule still applies to them, so a field given a narrower width, or a caption shaped wider than it was measured, is fitted rather than clipped. fitLine() allows 1e-6 of float error: a select or button whose width is its text plus padding would otherwise shrink by 0.001pt when the padding is taken back off.

Snapshots

Rasterised with pdftoppm at 120 DPI and compared against the fixtures on feature/pdfa-2-conformance. In each, the only pixels that change are in one 37–42 × 14px box around the maxlength field. Nothing else on the page moves.

  • form-fields-static: the maxlength field shows "12345" at 7.92pt instead of "1234" at 9.9pt. The DejaVu subset no longer carries the six unshaped Arabic codepoints the old trim loop measured, so the embedded font is 776 bytes smaller.
  • form-fields-active and form-fields-pdfa: the maxlength field's /DA is 0 Tf, and its appearance draws "12345" at 8.2pt, whole and centred, instead of clipping the last digit at 9.9pt.

The fixture combo boxes, buttons and image button all fit already, so their bytes are unchanged.

Verification

  • FormFieldShrinkTest (22 tests). Courier at 10pt, so the widths are exact.
    • Static text input: fits (whole, 10pt), overflows (whole, 7.086pt), past the minimum (trimmed to "ABC" at 6pt).
    • Shrunk table: a value that fits is drawn whole, at the same shrunk size as the text beside it. Fails if the padding is not divided by $k.
    • Arabic text input: a value drawn whole in a narrow field is the same shaped text as in a wide one, at a smaller size.
    • Static select: fits (10pt), overflows (6.926pt), past the minimum ("ABC" at 6pt). The arrow stays at 10pt.
    • Static select, Arabic: a trimmed choice is cut together with its OTL data.
    • Static button: fits (10pt), overflows (7.086pt), past the minimum (" AB" at 6pt).
    • Active text field: /DA size and appearance Tf for fits (10 / 10.000), overflow (0 / 7.220) and past the minimum (0 / 6.000, appearance "ABCD"). /V and /DV are whole in each.
    • Active combo box: fits (10 / 10.000), overflow (0 / 7.503), past the minimum (0 / 6.000, "ABC"). /Opt is whole.
    • Active push button: fits (10 / 10.000), overflow (7.503 / 7.503), past the minimum (6 / 6.000, "ABC"). /CA is whole.
    • Image button: keeps /DA … 10 Tf in a 2mm-wide field.
  • TextRecordingMpdf now also records the font size of each Cell().
  • Gates:
    • composer test: 3794 tests pass, with the same 5 skips.
    • --group=snapshot: 89 pass, with no refresh notes.
    • --group=conformance (veraPDF): 29 pass.
    • composer cs: clean.
    • PHPStan 2: clean apart from the unmatched Variable $c in isset() baseline entry for src/Image/Svg.php. That entry is unrelated and is being fixed in Drop the isset() on a foreach variable that PHPStan 2.2.15 no longer reports #451.
    • php -l under PHP 5.6: clean.

Limits

🤖 Generated with Claude Code

Comment thread src/Config/ConfigVariables.php Resolved
@jakejackson1

Copy link
Copy Markdown
Member Author

Do follow ups as part of this PR

…#433)

A text input's value, a combo box's choice and a push button's caption that
are too wide for the field are drawn in a smaller font, both into the page and
in an active field's appearance. The size scales with the overflow, rounded
down to 0.001pt, and goes no lower than half the field's size or 6pt. Past that
minimum the text is trimmed to whole characters, found by halving. One rule,
fitLine(), serves every case.

An active text field or combo box that shrinks is written with /DA 0 Tf so the
viewer sizes it too. A push button's /DA names the size its appearance was
drawn at. /V, /DV, /Opt and /CA keep the whole text.

The static button now shapes its caption through shapeText(), and a static
text input measures the value as Cell() draws it, padding shrunk with a shrunk
table included.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jakejackson1
jakejackson1 force-pushed the fix/433-shrink-field-text branch from c0cd7cd to af06334 Compare September 23, 2026 20:15
@jakejackson1 jakejackson1 changed the title Shrink a text input's value to fit its field instead of cutting it off (#433) Shrink a form field's text to fit its field instead of cutting it off (#433) Sep 23, 2026
…reports (#451)

The baseline ignored "Variable $c in isset() always exists" in Svg.php. PHPStan 2.2.15 stopped
reporting it, so the unmatched ignore failed static analysis on gravitypdf and every branch cut
from it. $c is always set inside its foreach, so the check goes and the ignore with it, which
passes under 2.2.14 and 2.2.15 alike.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jakejackson1
jakejackson1 merged commit 3a13fcd into feature/pdfa-2-conformance Sep 23, 2026
29 checks passed
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
form-fields-static draws its styled field in dark red on pale yellow inside a blue border, and
form-fields-active and form-fields-pdfa take that blue as the widget's border colour. The
page-break-avoid fixtures draw their fields' grey CSS border. Rasterised against the base branch,
nothing else changes; against this branch before its rebase onto #441, only the maxlength field
differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
…lect's border colour

form-fields-active and form-fields-pdfa write the styled field's 0.5mm border in /BS and draw it
in its appearance. page-break-avoid-forms and page-break-avoid-references draw their fields'
0.2mm CSS border, thinner than the 1pt default, and their select takes its grey colour too.
Rasterised against #432's fixtures only those borders change; against this branch before its
rebase onto #441, only the maxlength field differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
…) (#442)

* Draw a static form field in its CSS colour, background and border (#432)

A field drawn into the page, with active forms off, always had a near-white
fill, black text and a 0.2mm border in the colour already set. The form tags
now record the field's background and border, read from the BORDER-TOP
shorthand the cascade folds the border into, whether or not forms are active,
and Form draws text inputs, text areas, selects, buttons, checkboxes and radio
buttons with them, keeping the defaults for what the CSS leaves unset. The
disabled and read-only greys still win, and a border of style none or no width
is not drawn.

An active field's /MK /BC now also follows a border colour given in the border
shorthand, which only the border-color longhand reached before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share BorderMerger's border defaults with the form tags, and set a static field's colours in one place

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the static field style helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the form snapshots for a field's CSS colours and border

form-fields-static draws its styled field in dark red on pale yellow inside a blue border, and
form-fields-active and form-fields-pdfa take that blue as the widget's border colour. The
page-break-avoid fixtures draw their fields' grey CSS border. Rasterised against the base branch,
nothing else changes; against this branch before its rebase onto #441, only the maxlength field
differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
#445)

* Give an active form field the width and style of its CSS border (#431)

An active text field, text area, select or button always had a 1pt solid
border in /BS, whatever its CSS said. The border width, in points, and style
the form tags record now reach /BS and the appearance: solid, dashed, dotted,
inset and outset become /S, /D (dashed in the appearance too), /I and /B, and
a border of style none has no width and no /BC, which a viewer would draw
regardless. A select also takes its CSS border and background colours, which
it ignored before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share the active field colour fallback and the no-border rules between the field kinds

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the active border helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the active form snapshots for the CSS border width and the select's border colour

form-fields-active and form-fields-pdfa write the styled field's 0.5mm border in /BS and draw it
in its appearance. page-break-avoid-forms and page-break-avoid-references draw their fields'
0.2mm CSS border, thinner than the 1pt default, and their select takes its grey colour too.
Rasterised against #432's fixtures only those borders change; against this branch before its
rebase onto #441, only the maxlength field differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
#445) (#469)

* Give an active form field the width and style of its CSS border (#431)

An active text field, text area, select or button always had a 1pt solid
border in /BS, whatever its CSS said. The border width, in points, and style
the form tags record now reach /BS and the appearance: solid, dashed, dotted,
inset and outset become /S, /D (dashed in the appearance too), /I and /B, and
a border of style none has no width and no /BC, which a viewer would draw
regardless. A select also takes its CSS border and background colours, which
it ignored before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share the active field colour fallback and the no-border rules between the field kinds

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the active border helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the active form snapshots for the CSS border width and the select's border colour

form-fields-active and form-fields-pdfa write the styled field's 0.5mm border in /BS and draw it
in its appearance. page-break-avoid-forms and page-break-avoid-references draw their fields'
0.2mm CSS border, thinner than the 1pt default, and their select takes its grey colour too.
Rasterised against #432's fixtures only those borders change; against this branch before its
rebase onto #441, only the maxlength field differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Cherry-picked from c675d3f. PR #445 was merged into fix/432-static-field-css after #442 had
already merged that branch into feature/pdfa-2-conformance, so it never reached this branch.
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
…#433) (#441)

* Shrink a form field's text to fit its field instead of cutting it off (#433)

A text input's value, a combo box's choice and a push button's caption that
are too wide for the field are drawn in a smaller font, both into the page and
in an active field's appearance. The size scales with the overflow, rounded
down to 0.001pt, and goes no lower than half the field's size or 6pt. Past that
minimum the text is trimmed to whole characters, found by halving. One rule,
fitLine(), serves every case.

An active text field or combo box that shrinks is written with /DA 0 Tf so the
viewer sizes it too. A push button's /DA names the size its appearance was
drawn at. /V, /DV, /Opt and /CA keep the whole text.

The static button now shapes its caption through shapeText(), and a static
text input measures the value as Cell() draws it, padding shrunk with a shrunk
table included.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Drop the isset() on a foreach variable that PHPStan 2.2.15 no longer reports (#451)

The baseline ignored "Variable $c in isset() always exists" in Svg.php. PHPStan 2.2.15 stopped
reporting it, so the unmatched ignore failed static analysis on gravitypdf and every branch cut
from it. $c is always set inside its foreach, so the check goes and the ignore with it, which
passes under 2.2.14 and 2.2.15 alike.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
…) (#442)

* Draw a static form field in its CSS colour, background and border (#432)

A field drawn into the page, with active forms off, always had a near-white
fill, black text and a 0.2mm border in the colour already set. The form tags
now record the field's background and border, read from the BORDER-TOP
shorthand the cascade folds the border into, whether or not forms are active,
and Form draws text inputs, text areas, selects, buttons, checkboxes and radio
buttons with them, keeping the defaults for what the CSS leaves unset. The
disabled and read-only greys still win, and a border of style none or no width
is not drawn.

An active field's /MK /BC now also follows a border colour given in the border
shorthand, which only the border-color longhand reached before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share BorderMerger's border defaults with the form tags, and set a static field's colours in one place

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the static field style helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the form snapshots for a field's CSS colours and border

form-fields-static draws its styled field in dark red on pale yellow inside a blue border, and
form-fields-active and form-fields-pdfa take that blue as the widget's border colour. The
page-break-avoid fixtures draw their fields' grey CSS border. Rasterised against the base branch,
nothing else changes; against this branch before its rebase onto #441, only the maxlength field
differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
#445) (#469)

* Give an active form field the width and style of its CSS border (#431)

An active text field, text area, select or button always had a 1pt solid
border in /BS, whatever its CSS said. The border width, in points, and style
the form tags record now reach /BS and the appearance: solid, dashed, dotted,
inset and outset become /S, /D (dashed in the appearance too), /I and /B, and
a border of style none has no width and no /BC, which a viewer would draw
regardless. A select also takes its CSS border and background colours, which
it ignored before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share the active field colour fallback and the no-border rules between the field kinds

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the active border helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the active form snapshots for the CSS border width and the select's border colour

form-fields-active and form-fields-pdfa write the styled field's 0.5mm border in /BS and draw it
in its appearance. page-break-avoid-forms and page-break-avoid-references draw their fields'
0.2mm CSS border, thinner than the 1pt default, and their select takes its grey colour too.
Rasterised against #432's fixtures only those borders change; against this branch before its
rebase onto #441, only the maxlength field differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Cherry-picked from c675d3f. PR #445 was merged into fix/432-static-field-css after #442 had
already merged that branch into feature/pdfa-2-conformance, so it never reached this branch.
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
#441 moved SetJSButton()'s SetFormButton() call below the icon, so that the
field knows it shows one, and #447 keyed the icon by $this->formCount, which
is the button's number only once SetFormButton() has counted it. Merged
together, each icon went to the form before it: the widget lost its icon, the
object count reserved one that was never written, and SetFormButton() still
looked the icon up by name. The icon is now kept under the number the button
is about to get, and SetFormButton() looks for it there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
…#433) (#441)

* Shrink a form field's text to fit its field instead of cutting it off (#433)

A text input's value, a combo box's choice and a push button's caption that
are too wide for the field are drawn in a smaller font, both into the page and
in an active field's appearance. The size scales with the overflow, rounded
down to 0.001pt, and goes no lower than half the field's size or 6pt. Past that
minimum the text is trimmed to whole characters, found by halving. One rule,
fitLine(), serves every case.

An active text field or combo box that shrinks is written with /DA 0 Tf so the
viewer sizes it too. A push button's /DA names the size its appearance was
drawn at. /V, /DV, /Opt and /CA keep the whole text.

The static button now shapes its caption through shapeText(), and a static
text input measures the value as Cell() draws it, padding shrunk with a shrunk
table included.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Drop the isset() on a foreach variable that PHPStan 2.2.15 no longer reports (#451)

The baseline ignored "Variable $c in isset() always exists" in Svg.php. PHPStan 2.2.15 stopped
reporting it, so the unmatched ignore failed static analysis on gravitypdf and every branch cut
from it. $c is always set inside its foreach, so the check goes and the ignore with it, which
passes under 2.2.14 and 2.2.15 alike.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
…) (#442)

* Draw a static form field in its CSS colour, background and border (#432)

A field drawn into the page, with active forms off, always had a near-white
fill, black text and a 0.2mm border in the colour already set. The form tags
now record the field's background and border, read from the BORDER-TOP
shorthand the cascade folds the border into, whether or not forms are active,
and Form draws text inputs, text areas, selects, buttons, checkboxes and radio
buttons with them, keeping the defaults for what the CSS leaves unset. The
disabled and read-only greys still win, and a border of style none or no width
is not drawn.

An active field's /MK /BC now also follows a border colour given in the border
shorthand, which only the border-color longhand reached before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share BorderMerger's border defaults with the form tags, and set a static field's colours in one place

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the static field style helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the form snapshots for a field's CSS colours and border

form-fields-static draws its styled field in dark red on pale yellow inside a blue border, and
form-fields-active and form-fields-pdfa take that blue as the widget's border colour. The
page-break-avoid fixtures draw their fields' grey CSS border. Rasterised against the base branch,
nothing else changes; against this branch before its rebase onto #441, only the maxlength field
differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
#445) (#469)

* Give an active form field the width and style of its CSS border (#431)

An active text field, text area, select or button always had a 1pt solid
border in /BS, whatever its CSS said. The border width, in points, and style
the form tags record now reach /BS and the appearance: solid, dashed, dotted,
inset and outset become /S, /D (dashed in the appearance too), /I and /B, and
a border of style none has no width and no /BC, which a viewer would draw
regardless. A select also takes its CSS border and background colours, which
it ignored before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Share the active field colour fallback and the no-border rules between the field kinds

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Say what the active border helpers do more plainly

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Refresh the active form snapshots for the CSS border width and the select's border colour

form-fields-active and form-fields-pdfa write the styled field's 0.5mm border in /BS and draw it
in its appearance. page-break-avoid-forms and page-break-avoid-references draw their fields'
0.2mm CSS border, thinner than the 1pt default, and their select takes its grey colour too.
Rasterised against #432's fixtures only those borders change; against this branch before its
rebase onto #441, only the maxlength field differs, which #441 draws whole in a smaller font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Cherry-picked from c675d3f. PR #445 was merged into fix/432-static-field-css after #442 had
already merged that branch into feature/pdfa-2-conformance, so it never reached this branch.
jakejackson1 added a commit that referenced this pull request Sep 23, 2026
#441 moved SetJSButton()'s SetFormButton() call below the icon, so that the
field knows it shows one, and #447 keyed the icon by $this->formCount, which
is the button's number only once SetFormButton() has counted it. Merged
together, each icon went to the form before it: the widget lost its icon, the
object count reserved one that was never written, and SetFormButton() still
looked the icon up by name. The icon is now kept under the number the button
is about to get, and SetFormButton() looks for it there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working create-upstream-pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant