Commit Graph
6827 Commits
Author SHA1 Message Date
vangel76andCodex d292b85d5f M3: reveal recent files from the Home context menu (#5452)
Co-Authored-By: Codex <noreply@openai.com>
2026-10-31 13:32:19 +01:00
mtlcl410andClaude Opus 5.5 bcbc122de5 M5: the group parity note says what deleting does across readers
Deleting any member deletes its group on the page, as ISO 32000-2
§12.5.6.2 has it and PDF-XChange and Foxit do; a subordinate whose primary
is on another page is a comment of its own and stays. The note's Missing
list no longer says such a subordinate can't be selected, and the
cross-page test is its evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 20:29:12 +08:00
Grzegorz MartensandClaude Opus 5.5 0ed339901e M2.6: the JBIG2 images of an operation or a page share one allowance of decoding
One image has its own limit, about 6 s to 17 s, but nothing bounded a file of thousands of images
made to reach it: an operation took that long for each, and an image sharing /JBIG2Globals decodes
them again.

Image::decode_within (hayro-jbig2 patch 11) spends from what a run may still do, starting with its
page's pixels, and charge_reading charges reading a stream and its globals, 4 steps a byte, before
anything is parsed, so an image that fails has paid too. pdfcraft_filters::decode_jbig2_within takes
it, and ImageBudget in cos is that allowance: 2^34 steps, about 1,000 scanned pages, and 2^13 more for
each byte of the file, so a long scan is read whole. An image past it spends all that's left, and
later ones aren't read, globals included.

Optimize leaves such an image as it is and counts it in Report::images_refused. Image export leaves it
out, with the reason, and stops at 2 GiB of files held. Office export shares one allowance, leaves the
picture out and says the page was truncated. Redaction removes it whole, as any image it can't read.

Rendering gives a page's images 2^30 steps between them, inside the watchdog, and each page starts
afresh in Context::new as its other budgets do (hayro-syntax patch 31, hayro-interpret patch 73).
It's a thread-local, unbounded until a page sets it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 13:21:45 +01:00
Grzegorz MartensandClaude Opus 5.5 78d4877ae2 Merge fix/jbig2-retained-bitmaps: what an item reads is charged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 13:21:21 +01:00
Grzegorz MartensandClaude Opus 5.5 b7ec3669cc fix(render): what a JBIG2 item reads is charged, 38 an integer
From a review of the work count. An item with no pixels was charged a step, though reading it can take
hundreds of decisions, so a 22,515-byte PDF of refined text instances of no size stayed inside the
limit and took 730 s to render. Empty height classes and export runs weren't charged at all, and 19 KB
of them took 47 s. Each integer an item reads now costs what one takes at worst, 38, so a decision
never costs more than a pixel. A full region of 10,000 instances is 0.14% of the limit, so a real file
doesn't notice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 13:10:50 +01:00
Combiler01 e781d31187 fix(ui, test): resolve font-size inspect query and command-key paste tracking 2026-10-31 17:09:50 +05:30
Grzegorz MartensandClaude Opus 5.5 72e763ad12 fix(render): a JBIG2 symbol with no rows costs a step, and a refined instance is charged first
From CodeRabbit on the work count.

A symbol with no rows cost no work, though it is decoded all the same, so a stream of thousands of
dictionaries of such symbols, exporting none, went uncounted. Each symbol now costs a step more than
its pixels.

A refined text instance was charged after it was decoded, so one could still be 2^28 pixels past what
was left before the decoder refused. It's charged once its size is read, before anything is allocated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 11:51:15 +01:00
Grzegorz MartensandClaude Opus 5.5 43557fa046 M2: a test that a colour space referring to itself ends
The Pattern fix opened a recursion path: a Pattern's underlying space is now followed, as an Indexed
space's base always was. Self-references and cycles between the two end as a space that can't be
read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 11:44:23 +01:00
Combiler01 79eed72c08 Merge upstream/main into main preserving custom features
- Resolve all 13 merge conflicts between upstream/main and main
- Preserve full image editing suite: OBB, crop, proportional resize, arrange, and context menu actions
- Preserve text editing formatting tools: bullet/numbered lists, subscript/superscript, and line spacing
- Cleanly integrate upstream's canvas modularization, font updates, and styling changes
- Refactor arrange_image and run_edit_page_image helpers to satisfy clippy cognitive complexity limits
- All engine, edit, and UI integration test suites passing cleanly
2026-10-31 15:50:31 +05:30
mtlcl410andClaude Opus 5.5 9d7728e68a M6: a click in a same-name twin list box picks the row clicked
The click queued the clicked list box's own option positions under the
shared field name, but set_value reads ChoiceIndices in the first field of
that name. A twin listing options that share an export value in another
order therefore gave the first field the option at the same position, not
the one clicked. The UI now maps the twin's picks to the first field's
positions by export value and text (Field::positions_in, the same matching
the engine uses to copy /I to twins), falling back to the export values
when an option has no match there.

(review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 17:46:54 +08:00
Grzegorz MartensandClaude Opus 5.5 4ba8d3f530 Merge feat/redact-jbig2: the JBIG2 cap's doc and test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 10:46:52 +01:00
Grzegorz MartensandClaude Opus 5.5 7d53e07f43 M2.6: the JBIG2 cap's doc and test say what happens
The decoder has the same 2^28 cap as decode_jbig2, and can refuse a page first, so the doc says either
error can come. The page at the cap decodes, which the test now asserts, rather than failing later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 10:36:41 +01:00
mtlcl410andClaude Opus 5.5 665b361d5c M5: a group is one page's, as Acrobat reads it
A subordinate (/RT /Group) whose /IRT primary is on another page is now a
comment of its own, listed with its own author and text, rather than part
of that group. ISO 32000-2 §12.5.6.2 doesn't limit a group to a page, but
Acrobat (desktop and iPad) and PDF-XChange all keep such a subordinate when
the primary is deleted, and Acrobat desktop lists it on its own; tested on
a synthetic two-page file. pdfcraft_render::link_replies and
pdfcraft_annot::summaries both apply the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 17:04:57 +08:00
Grzegorz MartensandClaude Opus 5.5 ae94b54505 M10: export reads a /Decode array's numbers through references
Since the renderer now draws an image with /Decode [7 0 R 0], export disagreed with it. Its check of
which way round a stencil mask or a CMYK JPEG is compared the two numbers as given, and a reference
reads as none, so the file came out a negative of what the page draws.

Tests for the function arrays the previous commit's tuple fix also covers: a function's /Domain,
/Range, /Encode and /Decode are read a pair at a time too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 10:01:27 +01:00
Combiler01 87c1e858e3 Coderavbit Fixes 2026-10-31 14:23:19 +05:30
mtlcl410andClaude Opus 5.5 5d2332107a M6: a numeric radio option fills its own button, and stripping XFA reads /PCOn as the field's item
- form_fill took a JSON number for a radio group as text, so {"title": 1}
  on /Opt [(1) (2)] with on states /0 /1 turned on the second button. A
  number now resolves through state_for_export as the same option written
  as a string does.
- strip_xfa compared the XFA data with the selected button's /Opt entry
  only, but saving writes the button's /PCOn ahead of it. A group with
  /PCOn then reported a lost value on Flatten and XfaToStatic. The data
  now agrees with the field when it holds what saving writes
  (radio_dataset_value, made public) or a value that selects the same
  button (state_for_export).

Tests (each fails with its fix reverted): the automation form_fill radio
test now also fills 1, 2 and 3 as numbers; an engine test strips a group
whose /PCOn equals the state, and one whose /PCOn is neither the state
nor the /Opt entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 16:09:37 +08:00
mtlcl410andClaude Opus 5.5 7dbf380957 fix(forms): a turned field's editor reads the pointer through PagePointer (#4296)
The turned editor's caret placement read egui's pointer state directly
(primary_down, interact_pos, primary_pressed), which the page-pointer
guard refuses in page modules. The editor is an Area over the page, so
it reads a PagePointer for its own response: the press on it is its
own, held until the frame of its release, a touch's lift included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBVyQEwtmEw3mS1MoAiwrK
2026-10-31 16:05:27 +08:00
mtlcl410andClaude Opus 5.5 83d0654b0e fix(forms): a turned editable combo box types along its turn (#4296)
An editable combo box (ISO 32000-2 Table 233, Edit) turned by /MK /R
(Table 192) sized its font for the turn but still drew a horizontal
editor, so its text, selection and caret ran across the field while the
committed text ran along it. The combo editor now takes the field's
TextFrame and shares the turned text field's path: an upright layout at
the turned box's width, the pointer mapped back into the upright text,
and the text, selection and caret painted turned. The shared pieces are
pulled out of the text field editor (turned_layouter, show_field_editor,
turned_caret_and_paint) so the two editors cannot drift apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 16:05:15 +08:00
mtlcl410andClaude Opus 5.5 25d07f69b5 fix(forms): a turned field keeps its place and its text runs along the turn (#4296)
Setting a field's rotation (Properties > Position, form_set_props) swapped
the widget's width and height around its center, so a tall field placed
along a page edge jumped into a short, wide one, and typing in it showed
the text upright.

ISO 32000-2 Table 192 /MK /R turns the widget annotation relative to the
page; its /Rect stays the area it occupies in default user space. So a
rotation now changes only /MK /R: the rectangle stays, and the regenerated
appearance lays the text out along the turned direction (the box /BBox is
as wide as the field is tall, and /Matrix turns it onto /Rect).

On screen, the in-place editor and the just-committed preview paint the
text turned by /MK /R less the page's /Rotate and the view's rotation, as
the page will show it. The editor still takes the keys and pointer over
the field, and a press or drag places the caret in the turned text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 16:05:02 +08:00
Grzegorz MartensandClaude Opus 5.5 1352b3f0a2 Merge upstream/main
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 09:04:38 +01:00
Grzegorz MartensandClaude Opus 5.5 fa7acd3156 M2: a Pattern space's underlying space and a group of array items keep their references
Two more ways a reference was lost in the same readers. A Pattern space read its family name twice,
which took the underlying space when that was a name or a reference, so an uncoloured pattern took
its components as RGB: [/Pattern /DeviceCMYK] drew a cyan as red, direct names included (patch 72).

Tuples of array items, which /Decode, /W and /W2 are read as, took a reference at their start for the
whole tuple. A tuple can't be given by reference, so it was lost and the array ended there: an image
with /Decode [7 0 R 0] wasn't drawn, and CID widths fell back to /DW. A tuple now reads its items
directly, and each follows its own reference (hayro-syntax patch 32).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 08:58:25 +01:00
mtlcl410andClaude Opus 5.5 ade6b150a3 M12: an XFA reset restores groups, saved list values and structured picks, in bounded time
The reset of objects an opening script added before they have widgets
missed three kinds of value, and its name matching grew with the product
of objects and names (review):

- Exclusion groups were skipped, so a radio value set and reset in a new
  row stayed in the data. A group now resets to the on value of its
  default button, or to nothing.
- A choice list reset to the text it shows, not the item value it saves.
  The default now goes through Field::saved_value, as the live form
  reads it.
- A multi-select list whose picks the data holds as <value> elements
  compared as empty and could not be written, so its picks survived. A
  new DataOp::Reset compares and replaces those picks (none for an empty
  default); DataOp::Value still leaves nodes with children alone.
- Reset names are indexed (ResetTargets), so matching an object costs
  the same however many names a script passes, and forms::reset looks
  named fields up through sets instead of scanning the list per field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 15:58:23 +08:00
Grzegorz MartensandClaude Opus 5.5 84a2005f9e M2: an Indexed lookup table in an indirect string is read
A colour space [/Indexed /DeviceRGB 1 5 0 R] whose table is a string in object 5 couldn't be read:
the table was tried as a stream first, and a failed read uses up a reference, though not a direct
object, so nothing was left to read it as a string. The space then drew in grey from the index, so
a palette's colours were lost. The table is now read once, as whichever it is (hayro-interpret
patch 71).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 08:49:24 +01:00
Grzegorz MartensandClaude Opus 5.5 738cbadab7 M2.6: a page past the JBIG2 cap may be refused by the decoder first
The test said such a page is refused here, as Unsupported. #5491 makes hayro-jbig2 refuse it when
the stream is opened, as Corrupt, so whichever of the two PRs landed second would fail this test.
A page past the cap is refused either way, and that's what the test now says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 08:33:12 +01:00
Grzegorz MartensandClaude Opus 5.5 967c610aae Merge feat/redact-jbig2: a page past the cap may be refused by the decoder first
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 08:33:12 +01:00
Grzegorz MartensandClaude Opus 5.5 fc389071e2 Merge fix/jbig2-retained-bitmaps: the run's allowance spends the decoder's work count
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 08:28:07 +01:00
mtlcl410andClaude Opus 5.5 bdda289585 M3: a two-page spread's display time waits for both pages; the parity row says what full screen does
Review (CodeRabbit): in two-page view the /Dur timer started once the
current page had rendered, so the spread could turn while its other page
still showed Rendering…; it now waits for every page on screen. The
ui-parity row says full screen shows a fitted page or spread and that
background clicks and keys turn pages while clicks on page objects don't.
The doc comment of presentation_click_state is back on its function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 15:21:54 +08:00
mtlcl410andClaude Opus 5.5 00c4a86ac3 M2: an indirect layer label in /Order is decoded once
A nested /Order array may start with a text string label (ISO 32000-2
Table 99). One indirect string can head any number of direct arrays, and
each row decoded the whole string before cutting it to 256 characters, so
the work grew with rows times string length. Keep each indirect label
decoded once, by object number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 14:13:47 +08:00
mtlcl410andClaude Opus 5.5 5f757262f9 M2: print previews don't apply the View auto state; doc_info layer_order end-to-end test
A print preview (a request carrying the print tag, with or without the
canvas's scale and grayscale bits) rendered with the document's on-screen
settings, so a layer the View auto state turns off was hidden in the
preview but printed. Printing is not the View event (ISO 32000-2
8.11.4.4), so the preview now leaves the auto state off like the print.

Also add a tool-level test of doc_info's layer_order rows for a /Order
with a group, a labelled nested array and an unlisted group (1-based
layer index, name, label and depth).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 14:13:35 +08:00
mtlcl410andClaude Opus 5.5 2117186687 M2: the Layers panel presents the configuration's /Order tree (ISO 32000-2 Table 99)
The panel listed every group in /OCGs, flat. Table 99 says only the groups
/Order lists are presented, nested arrays as a tree, and a leading text
string in a nested array as a non-selectable label; in the default
configuration /Order defaults to the empty array.

- render: DocInfo::layer_order, rows of LayerRow { depth, item } where an
  item is a layer (index into DocInfo::layers) or a label. A nested array's
  entries are one level deeper than the layer or label before them. At most
  4096 rows, 32 levels and 256 characters a label; an indirect array is read
  once, so cycles end. DocInfo::layers is unchanged: unlisted groups keep
  their state, draw, print and answer layer_set and set-layer actions.
- ui-egui: the Layers panel draws the rows, indented 16 points a level, a
  label as a heading that can't be toggled; the count is the layers shown.
  A document whose /Order lists none says so.
- automation: doc_info reports layer_order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 14:13:35 +08:00
mtlcl410andClaude Opus 5.5 e5ce0afd02 M2: layers open in the state the document's view auto-state sets (ISO 32000-2 8.11.4.4)
The default configuration's /AS array (usage application dictionaries) was
never read, so a group whose /Usage /View /ViewState is OFF and that a
/View usage application manages still drew on screen.

- hayro-interpret patch (67): OcgState::from_catalog applies the View
  event's auto state after /BaseState, /ON and /OFF and before
  ocg_overrides. Each application with /Event /View and /View in
  /Category recommends each listed group's /ViewState; a group is ON only
  if every recommendation is ON. /Zoom, /User and /Language give no
  recommendation. At most 256 applications, 4096 /OCGs entries and 16
  categories each are read. InterpreterSettings::view_auto_state (on by
  default) switches it.
- render: RenderConfig::for_print turns it off; print as image sets it,
  since printing is not the View event.
- inspect: a layer's initial and visible state apply the same auto state,
  so the Layers panel and doc_info match the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 14:13:28 +08:00
mtlcl410andClaude Opus 5.5 f1c47db032 M6: a radio option whose export value is a number selects its own button (ISO 32000-2 Table 230)
A radio group with one /Opt export value per button and on states named
by position (/0, /1, ...; ISO 32000-2 Table 230) took the export value
"1" as the state /1, so it turned on the second button. Static XFA forms
build every exclusion group this way, with items 1, 2, 3. Asking for
option 1 selected option 2, 2 selected 3, and only the last option came
out right. Clicks wrote the button's position (0, 1) into the XFA data
instead of its item (1, 2), and XFA 3.3 ch. 4 and 17 say that data holds
the member's "on" item.

- Field::state_for_export resolves an export value: the per-widget /Opt
  first, then the on-state names. state_for, which callers holding a
  state (a click) use, is unchanged.
- form_fill resolves a radio option (the export value form_fields lists)
  with it, and so does opening a static XFA form for the data's item. The
  pre-strip comparison against the data compares export values.
- radio_dataset_value writes the selected button's /PCOn, else its /Opt
  entry, else its state name.

On 24 public XFA forms (benefit, disability, pension and visa
applications) a fill test flipped 329 radio groups on main and none with
this change.

Tests (each fails with the fix reverted): a forms unit test, an
automation form_fill test on a pure AcroForm group, and an engine test on
a synthetic static XFA exclusion group (open from data, click, save and
reopen).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBVyQEwtmEw3mS1MoAiwrK
2026-10-31 14:01:27 +08:00
mtlcl410andClaude Opus 5.5 3f708f8eb8 M6: list box picks survive same-name twins, repeats, Shift-click and an array /V
- A same-name twin gets the copied /I mapped to its own options by export
  value and text, so options listed in another order keep the option picked;
  one with no match there leaves the twin selecting from /V, never part of /I.
- A position picked twice is written once in /V and /I, so they still match
  item for item.
- Shift-click extends from the row clicked last, kept in the view: with rows
  sharing an export value the value can't say which came last.
- A single-select list loaded from an array /V writes one value when its
  shown row is clicked again.

(review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 14:00:56 +08:00
mtlcl410andClaude Opus 5.5 81f38ae618 M6: list boxes show and pick the option /I names, and a single-select list shows one value
Options are tracked by position as well as export value, so two options
sharing an export value (ISO 32000-2 Table 234, /I) show and pick the right
row; a single-select list given several values holds and shows the first;
/I matches /V item for item, repeats included; values match options in
linear time.

Rebased onto main as one commit: main split the forms crate's lib.rs into
read.rs and values.rs and moved forms_ui.rs into tools/. Folds the branch's
four commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 14:00:56 +08:00
mtlcl410andClaude Opus 5.5 1efd80e94e M6: form_fields names a check box's options by export only when each export ticks its own state
form_fill reads a name as an on state before an /Opt export, so an export
that equals another kid's on state would tick that kid instead
(ISO 32000-2 §12.7.5.2.3, Table 230). Fall back to the on-state names then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 13:59:31 +08:00
mtlcl410andClaude Opus 5.5 d16cbfb96b M6: form_fields lists a check box's kids by on state and reports the kid that is on
form_fields listed a check box's options by /Opt export, so kids sharing
the on state Yes with exports x and y showed as two options, though
filling either ticks both (ISO 32000-2 §12.7.5.2.3, EXAMPLE 2). It now
lists one option per distinct on state, named by its export unless two
states share one (Table 230 allows that), then by the state.

`checked` came from /V. It now follows the kid whose /AS is its on
state, which §12.7.5.2.3 makes decide where /AS and /V differ, so it
matches what the page shows.

Test: automation form_fields on shared-state, /AS-over-/V and
shared-export fixtures. Each assertion fails with its fix reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 13:59:31 +08:00
mtlcl410andClaude Opus 5.5 880ccd4c82 M6: a check box's kids with different on states tick one at a time (ISO 32000-2 §12.7.5.2.3, Table 230)
A check box field with kids whose on states are A and B could only ever
tick A. With A ticked, clicking B cleared the field, so B's tick flashed
and vanished, and with nothing ticked, clicking B ticked A. The click sent a
field-wide Check(!on), and write_value always turned on the first kid's on
state, even for a value naming B.

§12.7.5.2.3 makes the field's /V the on state of the kid that is on (/AS
deciding where they differ), and Table 230 lets kids be checked
independently.

- A click on a kid that is off sends its on-state name: it (and any kid
  sharing that state) turns on and the others off. A click on a kid that is
  on clears the field. "On" is the kid's /AS (Field::widget_on).
- write_value: a named state or /Opt export ticks the kids with that state.
  Check(true) keeps the kid that is on, else takes the first.
- Field::check_box_value maps a stored value to the state it names. Reset to
  /DV, script value changes and FDF/XFDF import use it.
- The display-only fallback ticks only the kids that are on.
- form_fields lists a check box's options and the checked one when its kids
  have more than one on state. form_fill takes the name.

Kids sharing an on state still tick together (EXAMPLE 2).

Tests: forms unit, ui-egui end-to-end clicks, automation form_fill and
xfdf import. Each fails with its fix reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 13:59:31 +08:00
mtlcl410andClaude Opus 5.5 e35d028d4a M12: an XFA reset reaches fields a script added while the form opened, before they have widgets
resetData resolved its targets through the generated fields, so a field of
a row an opening script added, with no widget until the form is laid out
again, kept the value a later script gave it, and the final layout saved
it. The reset now also walks the live form and puts the template's default
back in the data of every matching field with no widget yet (review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:57:42 +08:00
mtlcl410andClaude Opus 5.5 71a42a20d7 M12: merge a run of XFA resets through a set, not a list scan
Resets in a row are applied together; the names were deduplicated by
scanning the kept list for each new one, quadratic in the names a script
passes (its effects may carry hundreds of thousands within the payload
cap). The run now keeps a set beside the ordered list, and a reset of the
whole form still takes in the rest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBVyQEwtmEw3mS1MoAiwrK
2026-10-31 13:57:33 +08:00
mtlcl410andClaude Opus 5.5 d65c465b1b M12: XFA open-time scripts start from one shared copy of the form
On a large dynamic XFA form, every script of an event copied the whole form
twice before it ran (the engine's live form to the script engine's tree, then
that tree to the flattened form the host works on), and every resetData call
rewrote and rescanned the whole document. On a 1,300-script form opening spent
its 3 s budget on these copies and on twenty resets, and skipped the last 850
initialize and calculate scripts.

The engine now sends the scripts of an event one shared tree (Arc) until the
live form changes in any way, and the script thread keeps the flattened form
it built from that tree; each script starts from a copy whose text is shared
(Arc<str>), so it costs a fraction of a flatten. Each script still gets its
own copy: nothing one script changes reaches the next except through the
engine. Resets in a row in one script's effects are applied as one reset of
the names together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBVyQEwtmEw3mS1MoAiwrK
2026-10-31 13:57:32 +08:00
mtlcl410andClaude Opus 5.5 bc5aff5ff6 M12: lay a dynamic XFA form out once after its open-time scripts
On opening, the engine laid the form out again after every initialize or
calculate script that changed presence, access or instances. On a large form
one layout takes about the whole 3 s open budget, so the remaining initialize
scripts were skipped, and that half-initialized form was what saving kept: each
later opening hid more of it, and a page shown at the first opening, filled in,
was hidden and its data reset by the next one.

The scripts read the live form (template, data and overrides), not the pages,
and XFA 3.3 fires initialize after data binding, before layout (pp. 388, 390,
407). On opening, a needed layout is now recorded and done once in finish().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBVyQEwtmEw3mS1MoAiwrK
2026-10-31 13:57:32 +08:00
mtlcl410andClaude Opus 5.5 914001a784 M10: the missing-DLL test checks that printers() never asked the backend
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:56:09 +08:00
mtlcl410andClaude Opus 5.5 f1753c1431 M10: test the print entry points against a Windows without the DLLs (#2630)
Review follow-up on #2701: the test no longer requires the DLLs in the
host's System32 (the trimmed installations this supports lack them).
Instead a test-only override points the lookup at an empty folder and
submit, submit_with_progress and printers are called through: printing
is refused naming the DLL and no printers are listed, before any call
into the delay-loaded DLLs. The job names a printer that doesn't exist
and the bytes aren't a PDF, so a missing guard can't reach a real one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:56:09 +08:00
mtlcl410andClaude Opus 5.5 03a147eced M10: Windows without the print DLLs still starts (#2630)
pdfcraft.exe and pdfcraft-cli.exe imported windows.data.pdf.dll and
prntvpt.dll at load time (through craft-print's printing), so a trimmed
Windows installation without them refused to start the program at all.
The executables now delay-load the two DLLs, and the spool adapters
check that they exist before calling in: without them the printer list
is empty and a print job fails with a message pointing to Save as PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:56:09 +08:00
mtlcl410andClaude Opus 5.5 2d21753b1e M3: a page's display time starts once it has rendered; the Wipe test checks what is painted
Review on #5316:
- Full screen started a page's /Dur (ISO 32000-2 §12.4.4.1) when the page
  became current, so a slow render could use up its display time while the
  page still said Rendering…. The time now starts once the page's raster has
  arrived, or at once for a page the renderer can't draw.
  Test: a_display_time_starts_once_the_page_has_rendered, which fails with the
  fix reverted. a_display_time_on_the_last_spread_does_not_redraw_every_frame
  now gives its page a raster, so it still reaches the display time.
- full_screen_plays_a_page_transition_and_honours_the_display_time also checks
  the Wipe's painted output: a textured strip of page 2 as tall as the page and
  only part of its width. It fails when the presenter stops painting the
  incoming page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:50 +08:00
mtlcl410andClaude Opus 5.5 94d3e628b0 M3: full screen clicks on fields and notes, Shift+Ctrl first and last page, no redraw while a page renders
- A click on a link, form field or comment turns no page in full screen:
  the pointer stays active to click links and open notes (Adobe Acrobat
  Help, 2019, p. 65).
- Shift+Ctrl+Page Up / Up Arrow go to the first page and Shift+Ctrl+Page
  Down / Down Arrow to the last, as Home and End (p. 83).
- A transition waiting for its incoming page looks again every 50 ms
  rather than asking for every frame; the render cache wakes the window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:50 +08:00
mtlcl410andClaude Opus 5.5 689b5790c4 M3: full screen review fixes: a new document starts afresh, a failed page ends its transition, no redraw at the last spread, the pointer hides over links
- Replacing the document clears the presenter: no transition, page or
  timer of the old document carries over.
- A transition into a page that failed to render ends at once instead of
  waiting for a texture that never comes.
- A display time that expires on the last spread asks for a redraw only
  when the page actually moved, so the last spread doesn't redraw every
  frame.
- A still pointer hides through a cursor claim on the top layer, which
  every tool reaches, so it hides over a link too, and its tip with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:50 +08:00
mtlcl410andClaude Opus 5.5 d51ac9a547 M3: in full screen a right-click and Shift+Enter go back a page (#5315)
A left click goes forward a page in full screen; a right-click now goes
back one, and full screen shows no context menu, as it shows no tools
(Adobe Acrobat Help, 2019, "Full Screen preferences", p. 69: "Left Click
To Go Forward One Page; Right Click To Go Back One Page").

Enter goes forward a page and Shift+Enter now goes back; it went forward
too (Adobe Acrobat Help, 2019, "Read a document in Full Screen mode",
p. 66: "To go to the previous page, press Shift+Enter").

parity: view.full-screen and view.full-screen-presentation cite the new
tests and say what is still missing; organize.page-transitions is now
played. docs/ui-parity.md row and revision history updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:50 +08:00
mtlcl410andClaude Opus 5.5 f15e8c5115 M3: full screen plays page transitions and advances by display time (#379)
In full screen, a page's transition (/Trans, ISO 32000-2 §12.4.4, Table
164) plays when the page comes into view, from the outgoing page's raster
to the incoming one's (render::transition geometry), and a page's display
time (/Dur) advances to the next page once it is up. A still pointer
hides after three seconds and shows again when it moves.

- Transitions play in single-page view without view rotation, once the
  incoming page has rendered; spreads, a rotated view and the Animation
  effects preference set to off change pages at once.
- Display times count from the end of the transition and stop at the
  last page; the reader can turn the page sooner. The document's
  durations are bounded (a transition at most 10 s).

The logic lives in canvas/presenter.rs; canvas.rs keeps its state on
DocView and calls it after drawing the pages, and the Animation effects
preference reaches it through PageEnv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:50 +08:00
mtlcl410andClaude Opus 5.5 a26f8db0bc M6: stamp_custom's line test uses a template the schema accepts (#1741)
The test sent a 500-character line, past the schema's maxLength of 200,
and only checked an upper bound on the page text, which also passes when
the line is missing. It now sends a 198-character template whose filled-in
line runs to 264 characters, and checks the saved /PCByLine holds exactly
200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-10-31 13:52:29 +08:00