Commit Graph
66 Commits
Author SHA1 Message Date
aiongg f84eeaed7a Integration: a non-interactive XFA field is measured at the width it is drawn (#3515 × #3521)
#3515 measures a growing non-interactive field at its text's scale but
with a widget's 4pt of padding, while the layout draws its text without
it. Once #3521 fits lines by their ink, the narrower measuring width
wrapped to one more line than the drawn text, leaving a blank line
below it. The measurement leaves out the padding the draw doesn't have.
2026-10-22 04:15:17 +00:00
aiongg 4b85c697f9 Merge PR #3521: M12: a space at the end of a line doesn't count when fitting XFA text
crates/xfa/src/tests.rs: union of #1648's TIFF orientation test and #3521's tests.
2026-10-22 01:49:27 +00:00
aiongg b2b42c89db Merge PR #2993: Render month and weekday names in XFA date patterns
crates/xfa/src/data.rs: #2993's month and weekday helpers and date_tokens doc, with date_tokens kept pub(crate) for #3782's formatted_value and #3397's data pictures.
2026-10-22 01:49:20 +00:00
aiongg da7f592cd0 Merge PR #1648: XFA: decode BMP and TIFF pictures
crates/xfa/src/tests.rs: union of fixture imports (tiny_bmp, tiny_tiff).
parity/acrobat-features.toml: form.xfa and the XFA image entry: evidence lists unioned, notes take both sides' insertions.
2026-10-22 01:49:05 +00:00
aiongg 88c21daaed Merge PR #2615: fix(xfa): enforce maxLength on rich-text fields
ROADMAP.md, docs/roadmap.md: all status lines and progress-log lines kept; M12 row takes both 'Done since' insertions.
parity/acrobat-features.toml: form.xfa evidence lists unioned, notes take both sides' insertions.
2026-10-22 01:48:32 +00:00
aiongg 9865f27d8c Merge PR #2619: fix(xfa): run click scripts for every repeated print button
ROADMAP.md, docs/roadmap.md: both status lines and progress-log lines kept; M12 row takes both 'Done since' insertions.
crates/automation/tests/automation.rs, crates/xfa/src/fixtures.rs: union of #2624's and #2619's tests and fixtures.
parity/acrobat-features.toml: form.xfa evidence lists unioned, notes take both sides' insertions.
2026-10-22 01:48:18 +00:00
aiongg a0a9e3370e Merge PR #3408: M12: an XFA script that fails partway keeps what it changed before the error
crates/engine/src/tests.rs: union of #2624's tests and #3408's test.
parity/acrobat-features.toml: form.xfa evidence lists unioned, notes take both sides' insertions.
2026-10-22 01:47:22 +00:00
aiongg 3ba586fe31 Merge PR #2624: fix(xfa): reflow growable multiline fields after filling
crates/xfa/src/script.rs: template_field and named_in moved to crate::data in #3397; field_grows_with_text calls crate::data::template_field.
parity/acrobat-features.toml: form.xfa evidence lists unioned, notes take both sides' insertions.
2026-10-22 01:46:50 +00:00
aiongg be69bfadf9 Merge PR #3515: M12: XFA text honors its horizontal font scale
crates/xfa/src/layout.rs: both sides added doc comments to value_height, caption_reserve, field_height, unique_name and draw_field; kept HEAD's, with #3542's natural_width.
2026-10-22 01:46:14 +00:00
aiongg 8031d345d4 Merge PR #3542: M12: XFA labels and buttons without a size grow to their content
crates/xfa/src/layout.rs: both sides added a draw_field doc comment; kept #3542's (the more complete one).
2026-10-22 01:46:05 +00:00
aiongg dbc2647f48 Merge PR #3397: M12: XFA dates are written and read in the field's data picture
crates/engine/src/tests.rs: union of #3180's new test and #3397's doc comment on the next test.
crates/xfa/src/layout.rs: kept #3782's formatted_value (it calls date_pattern, now built on date_letters) and button_action doc.
crates/xfa/src/parse.rs: parse_field doc comment from #3397 (names the data picture).
crates/xfa/src/script.rs: field() doc from #3582 with #3397's "as scripts read it".
crates/xfa/src/tests.rs: union of fixture imports and of the new tests; one doc comment each for the date-conversion and data-fill tests.
2026-10-22 01:45:58 +00:00
aiongg 0bf197f07b Merge PR #3582: M12: showing an XFA subform leaves its unnamed hidden objects hidden
crates/xfa/src/script.rs: both sides added doc comments to the same functions; kept #3582's (they describe its presence(name, ...) signature).
2026-10-22 01:45:16 +00:00
Eric Kaden 526d87d85c M6: formattedValue formats only a value of the ISO date's own shape
2026-1-2 isn't an ISO date and stands as it is. A test also pins that
parentheses hold a picture's locale (date(en_US){YYYYMMDD} formats) and
that a clause without braces has no pattern.
2026-10-21 00:09:00 -04:00
Eric Kaden 21b6267129 M6: a display picture with month or weekday names leaves formattedValue raw
date{DD MMM YYYY} and date{EEE …} have parts formatted_value can't show
yet, so it gives the raw value instead of text like 20 mmm 2026.
2026-10-20 23:57:14 -04:00
Eric Kaden 6a8ea287aa M6: doc comments on the functions the formattedValue change touches 2026-10-20 23:37:21 -04:00
Eric Kaden c0a513eed8 M12: scripts read a date in its data picture as the ISO date
A date the field's data picture writes as 20261018 reaches scripts as
2026-10-18, the rawValue another viewer gives them, so a script that
checks String(rawValue).length == 10 works (DA Form 31's 10b TO).
Doc comments on the functions this branch touches.
2026-10-20 23:33:23 -04:00
Eric Kaden 7176ebde94 M6: XFA formattedValue shows a date in the field's display picture
Fields keep their <format><picture>. A date display picture turns the
ISO value into its pattern for scripts' formattedValue (JavaScript and
FormCalc), so date arithmetic on formattedValue works as forms expect.
Once a script sets the value, formattedValue gives that value. Number
and text display pictures still give the raw value.
2026-10-20 23:29:08 -04:00
Eric Kaden 572e01a71d M12: the wrapping test checks the text stays within its room 2026-10-20 09:39:32 -04:00
Eric Kaden f9daeeb1fa M12: doc comments for the functions around this change 2026-10-20 09:25:19 -04:00
Eric Kaden 15eef03efc M12: doc comments for the functions around this change 2026-10-20 09:24:47 -04:00
Eric Kaden ee91673162 M12: doc comments for the functions around this change 2026-10-20 09:21:31 -04:00
Eric Kaden ec14687c6d M12: a draw without text or a width keeps the width it has room for 2026-10-20 09:20:55 -04:00
Eric Kaden a3b942021f M12: doc comments, and words keeps its own 2026-10-19 23:46:56 -04:00
Eric Kaden 5cd7e816b9 M12: doc comments for the functions this change touches 2026-10-19 23:46:16 -04:00
Eric Kaden 24b55275a5 M12: doc comments for the functions this change touches 2026-10-19 23:46:14 -04:00
Eric Kaden 15ab8c7a2c M12: doc comments for the functions this change touches 2026-10-19 23:42:22 -04:00
Eric Kaden 35e04743d0 M12: showing an XFA subform leaves its unnamed hidden objects hidden 2026-10-19 21:27:47 -04:00
Eric Kaden 37f43e947d M12: an XFA button's box is its whole field
A button was given its content area (inside its margins) as its widget
rectangle, though its border belongs to the field: DA Form 31's
Instructions button, with a 1.25 pt top margin, came out shorter than
the Attachments Menu button beside it. Its box is now the whole field;
the margins pad the caption.
2026-10-19 15:41:00 -04:00
Eric Kaden da38e0da6f M12: an XFA button without a height is as tall as its caption
A button with no height was sized like a text field in its field font,
with text-field padding, so DA Form 31's Instructions button (10 pt
field font, 8 pt caption) came out about 17 pt tall and over the form
below it. It is now as tall as its caption, never below its minimum.
2026-10-19 15:26:37 -04:00
Eric Kaden 32bb14b952 M12: an XFA label or button without a width is as wide as its text
A draw or a button with no width took all the width available, so a
right-aligned label slid to the far side of its subform and a button
spread over what lay beside it: DA Form 31's Instructions button covered
its header and the email line, and its PERSONNEL/FINANCE line ran into
the field after it. They now grow to their text, unwrapped, within what
is available and never below their minimum width, as containers do.
2026-10-19 15:06:32 -04:00
Eric Kaden 6dc8ad933b M12: spaces alone stay on an XFA text line
A word of spaces alone draws nothing, but after a word whose own
trailing space ran past the box it failed the fit test and opened a
blank line, so the text measured a line taller than it draws. Such
words now always stay on the line, keeping their width.
2026-10-19 14:53:28 -04:00
Eric Kaden dd782bca1d M12: a non-interactive XFA field is measured at its text's horizontal scale
The layout draws a non-interactive field's text itself, condensed, but
measured its height at full width, so a condensed value reserved lines
it didn't use. Fields now measure and draw their text in one face:
scaled when the layout draws it, as designed when the forms layer does
(the over-page fallback included).
2026-10-19 14:42:37 -04:00
Eric Kaden b2f40e0442 M12: a space at the end of a line doesn't count when fitting XFA text
Words keep the space after them, and the line-fit test counted it, so a
label written with a trailing space wrapped when its box was a fraction
of a point narrower than the label plus that space: DA Form 31's 'a.
DATE ' and 'b. TIME ' put their second word on top of the field below.
A line now fits by what it draws, and alignment ignores every trailing
space, not just one.
2026-10-19 14:22:22 -04:00
Eric Kaden 162a891673 M12: XFA text honors its horizontal font scale
fontHorizontalScale on a font, and xfa-font-horizontal-scale in rich text,
condense the glyphs; PdfCraft ignored both, so condensed labels were laid
out at full width and overflowed or wrapped where the form fits them on
one line. Text is now measured at its scale and written with Tz, in a
graphics state of its own. Field values keep full width: the forms layer
draws them, and its appearances have no horizontal scaling.
2026-10-19 13:56:03 -04:00
Eric Kaden 8f0557d2bc M12: an XFA script that fails partway keeps what it changed before the error 2026-10-19 01:13:09 -04:00
Eric Kaden 097c452c84 M12: a date its data picture can't hold stays ISO in the data
A two-digit year reads back as 1950 to 2049, so 2050 written as 50 came
back as 1950. A date is now written in the data picture only when it
reads back from it unchanged.
2026-10-19 00:26:05 -04:00
Eric Kaden 38d3a6c843 M12: each XFA date field uses its own data picture, and only a whole-date one
The template field behind a SOM path is now found by its number, as the
form numbers same-named siblings and repeated instances; the live form's
value refresh uses the same lookup. A data picture without a year, month
and day (date{YYYYMM}) keeps ISO dates in the data, since it can't hold
the date the field shows.
2026-10-19 00:18:03 -04:00
Eric Kaden 93f90ef760 M12: XFA dates are written and read in the field's data picture
A field's data picture (<bind><picture>, such as date{YYYYMMDD}) is how
its value is written in the XFA data, but PdfCraft always wrote dates
there as ISO (2026-10-18) and read them back as ISO, so a form that keeps
its dates as 20261018 got a different format from PdfCraft than from
other viewers, and data those viewers wrote was shown as stored.

The parser keeps <bind><picture> as Field::data_picture. A typed date is
still read in the field's own pattern and turned into ISO; it is then
written in the data picture when the field has one. Reading goes the
other way, on layout and when values are taken from the data of a form
laid out before. A value that doesn't match its data picture is read as
ISO, so data written by earlier versions still reads. The date-letters
rule for XFA picture clauses moves to one helper (date_letters) that the
layout's date_pattern now uses too.
2026-10-18 23:46:43 -04:00
Marco Arnulfo 947f0f2994 XFA: turn TIFF pictures by their Orientation tag 2026-10-18 20:37:33 +02:00
Marco Arnulfo a4cdbb6235 XFA: decode BMP and TIFF pictures (fixes #1644)
Pictures in templates and data that are BMP or TIFF were left out with a
warning. They are now recognised by their signature, sized from their
headers, and decoded through the same bounded reader as GIF (first page
of a TIFF). A BMP needs a valid info-header size after "BM", so text
starting with those two letters is still not taken for one.

A BMP or TIFF chosen for an XFA image field is kept in the data as
image/bmp or image/tiff, since the layout can now show it.
2026-10-18 19:21:49 +02:00
PerchAnton 4119359c7d M12: retain accepted whitespace when structured XFA data cannot sync 2026-10-18 19:54:41 +03:00
PerchAnton 12210a350d M12: retain product notes while integrating current main 2026-10-18 19:42:01 +03:00
PerchAnton b7b4ab0c8d M12: retain product notes while integrating current main 2026-10-18 19:39:17 +03:00
PerchAnton c3df50e8dd M12: retain product notes while integrating current main 2026-10-18 19:36:34 +03:00
NetterSilverandClaude Haiku 5.5 84ee69b507 Render month and weekday names in XFA date patterns
Found while testing crates/xfa/src/data.rs:265-281 (iso_to_pattern, with date_tokens at :242 and pattern_to_iso at :285; pattern built in crates/xfa/src/layout.rs:396 date_pattern)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 10:13:39 +02:00
hcchung1 c5708e1cc6 fix(xfa): a page area's occur min gets its pages after the body (#2574)
A page area with <occur min="1" max="1"> that the body never reached was
never laid out, so the public ISCIII form lost the page that holds its
finishing instructions and the TERMINAR MEMORIA button once the repeated
copies over the body pages were removed.

PageArea records occur min (0 without an <occur>). When the body has been
laid out, an area used fewer times than its minimum gets the pages it still
needs, in template order, after the body's pages. The form is 7 pages with
the once-only page last, which is what Acrobat Pro shows.
2026-10-17 11:58:50 +08:00
hcchung1andClaude Sonnet 5.5 31716e7058 fix(xfa): a page area without <occur> has no limit (fixes #2574)
A pageArea with no <occur> was given a subform's default (at most one use). Once the
first body page was out, the layout fell back to the last page area, here one with
occur max="1", and drew its content over every body page, with a copy of its fields
per page. A page area with no <occur> now repeats as long as pages are needed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 10:46:25 +08:00
PerchAnton 97d286b2b9 M12: reflow growable XFA text after form edits (#2569) 2026-10-15 20:33:03 +03:00
PerchAnton f06bebd520 M12: dispatch repeated XFA print buttons by their own field (#2572) 2026-10-15 20:08:05 +03:00
PerchAnton a146648648 M12: enforce XFA rich-text maxLength (#2570) 2026-10-15 19:52:42 +03:00