100 Commits
Author SHA1 Message Date
FredAppsandFredApps 4f23ee1c1c test(rename): separate filename and full-path boundary fixtures (#7965)
* test(rename): separate filename and full-path boundary fixtures

* Preserve repository LF endings in rename test fixtures

* Preserve UTF-8 text in rename fixture repair

---------

Co-authored-by: FredApps <[email protected]>
2026-11-20 16:16:33 -05:00
FredApps 1feb7c3f05 Merge pull request #7147 from indy2kro/fix/7010-active-pane-edge-under-menus
fix(ui): split view's active-pane line is drawn under open menus (#7010)
2026-11-20 21:46:33 +07:00
FredApps b50a17f717 Merge pull request #7180 from rezaprama/fix/redact-unreadable-annotations
fix(redact): refuse annotations with unreadable bounds
2026-11-20 21:04:09 +07:00
FredApps c05499f707 Merge pull request #2923 from regendorf-ux/pr/tab-rename
Rename the open file from its tab (Rename… and double-click), with names that work on every system (#2102, #2867)
2026-11-20 21:03:47 +07:00
FredApps 6de83353bd Merge pull request #7916 from dotCooCoo/fix/fonts-embedding-test-stream
Fonts: the embedding tests import Stream
2026-11-20 09:16:43 +07:00
FredApps 5b8cb8ab61 Merge pull request #7830 from storytold/fix/pptx-parity-20261119
Restore plain PPTX tables and shared-writer regression checks
2026-11-19 08:12:39 +07:00
FredApps 21a9d8b1be Merge pull request #7825 from FredApps/test/button-script-completion
test(ui): await native button-script completion
2026-11-19 07:36:44 +07:00
FredApps 60ca578c37 test(ui): await native button script completion 2026-11-19 00:37:30 +01:00
FredApps 3bc2adbe28 Merge pull request #7805 from FredApps/ci/gate-cleanup-budget-778
ci: allow native gate cleanup to finish
2026-11-19 05:29:14 +07:00
FredApps 1f3aa5311c Merge remote-tracking branch 'origin/main' into ci/gate-cleanup-budget-778 2026-11-18 22:32:53 +01:00
FredApps 56f19a32c0 Merge pull request #7811 from FredApps/test/startup-password-completion-order
test: avoid racing startup password completion order
2026-11-19 04:32:05 +07:00
FredApps f9bfa19e74 test: keep startup password assertions independent of worker order 2026-11-18 21:26:45 +01:00
FredApps ec7e4342f7 ci: allow native gate cleanup to finish 2026-11-18 20:15:17 +01:00
FredApps bad6ac7fa2 Merge pull request #7779 from FredApps/chore/778-xfa-merged-pin
Use merged XFA namespace and BOM safety fixes
2026-11-19 00:57:14 +07:00
FredApps fe16ea4834 fix(xfa): classify shared namespace admission as too large 2026-11-18 18:07:30 +01:00
FredApps 39b3f45a9d Merge current main to validate the #778 dependency pin with baseline repairs 2026-11-18 17:07:47 +01:00
FredApps 6d95958ccc Use merged XFA namespace and BOM safety fixes 2026-11-18 16:08:32 +01:00
FredApps 64c10d450c Merge main into onee/fix-annot-tests 2026-11-18 19:51:06 +07:00
FredApps 562c428c6f test(annot): retain current opacity and review-state semantics (#7721)
* test(annot): retain current opacity and review-state semantics

* style: wrap fixture imports at repository width
2026-11-18 19:08:31 +07:00
FredApps e56b03fbae test(annot): assert URL scan work instead of wall-clock speed (#7695) 2026-11-18 17:41:12 +07:00
FredApps 2d2c2f7e18 fix(xfdf): retain canonical Cargo lock package order (#7698) 2026-11-18 17:39:57 +07:00
FredApps f8211b6aaf Merge main into onee/fix-annot-tests 2026-11-18 17:14:34 +07:00
FredApps ae30592466 Update annotation tests after SaveOptions, Style, LinkAction, and Shape changes
#2523's tests were written against earlier field lists. Later work added
id_entropy, border and opacity style fields, a zoom on page links, and a
line on custom stamps, so cargo xtask ci now fails at clippy on main.

The tests keep the same intent: page links still use Fit Page, the view they
had before they carried a zoom, and the extra style and stamp fields take
their defaults.
2026-11-18 16:55:06 +07:00
FredApps a49949388b fix(test): allow the unused mut on Windows in the private test folders (#7595)
#5923 made the pptx LibreOffice test and the staging tests build their
folders with a DirBuilder that only Unix sets a mode on. On Windows the
binding is never changed, so -D warnings stops the build with unused_mut
and main's Windows gate is red.
2026-11-17 05:52:32 +01:00
FredApps efd265563e Merge pull request #7330 from MMexicann/patch-8
docs(prc-render): name the current craft-prc parser dependency
2026-11-16 17:20:43 +01:00
FredApps 412e6963b5 Merge pull request #7529 from storytold/onee/778-pdf-content-facade
refactor(content): re-export craft_pdf::cos::content
2026-11-16 14:54:16 +01:00
FredApps 3d43364928 fix(crypt): write RC4 fixtures through the legacy entry points
Pinning craft-pdf to the #1852 merge SHA also picked up d74e60b2, which
makes create() and set_encryption() refuse RC4-40 and RC4-128. Tests,
helpers and the protect example that still write those schemes now use
create_legacy and set_encryption_legacy. Edit::Protect does the same
when the chosen algorithm is legacy, so a file that must stay readable
by a reader without AES can still be written.
2026-11-16 14:11:36 +01:00
FredApps 99ef606491 refactor(content): point the facade at craft-pdf #1852
Pin craft-pdf to 8e03cd016d42032b867fef6bad86bc69bf2c1920 and re-export
craft_pdf::cos::content. Other craft-libs pins stay on e2dc681a3.
2026-11-16 13:42:15 +01:00
FredApps f9aca964b1 refactor(content): re-export craft_pdf::cos::content
The parser, serializer and matrices now live in craft-pdf (craft-libs#1852,
pin 8e03cd016d42032b867fef6bad86bc69bf2c1920). pdfcraft-content becomes a
facade, like pdfcraft-cos. The unit tests moved with the implementation;
hayro_sign_tokens stays here. Other craft-libs pins are unchanged.
2026-11-16 13:42:01 +01:00
FredApps 207a50ef13 Merge pull request #7344 from MMexicann/patch-20
test(create): fail explicitly for invalid one-bit RGB fixtures
2026-11-16 12:33:12 +01:00
FredApps 9d061a7668 Merge pull request #3762 from AdrianTM/feat/comments-panel-shortcut
Ctrl+M opens the Comments panel (#3741)
2026-11-16 11:51:05 +01:00
FredApps 75a6ce50c3 Merge pull request #7377 from gmrmad1/docs/roadmap-2026-11-15
docs: bring ROADMAP.md and parity assessment current through 2026-11-15
2026-11-16 10:23:45 +01:00
FredApps 923dd9f593 Merge pull request #7449 from storytold/extract/shared-export-base64
export: replace local Base64 encoder with existing craft-mime
2026-11-16 07:42:08 +01:00
FredApps a0bc1b3477 Revert "xfa: avoid rescanning prototype-only child lists"
This reverts commit 5410dc1c. The XFA prototype-walk optimization is
unrelated to the #778 Base64 cutover; keep it for its own PR with a
measured benchmark (craft-libs#778 consumer PRs stay single-purpose).
2026-11-16 06:53:25 +01:00
FredApps 1c7b507a24 Merge pull request #7475 from storytold/extract/shared-signature-verification
sign: replace local signature verification with existing craft-pkcs7
2026-11-16 06:42:14 +01:00
FredApps 070432ca44 i18n: move the craft-i18n pin to 866aff71 (#7417)
Pick up craft-i18n main, including French menu paths that use ">"
instead of "▸" (#296) and Portuguese (Brazil) byte-unit rows in the
shared catalog (#205).
2026-11-15 12:23:39 +01:00
FredApps c944f106dd Merge pull request #7350 from christianlappin/fix/7175-update-download-test
Tests: keep the update download test stable in Linux coverage
2026-11-15 01:06:17 +01:00
FredApps b5327e03f6 Merge branch 'main' into fix/7175-update-download-test 2026-11-15 00:04:42 +01:00
FredAppsandFredApps 2524889a6b i18n: move the craft-i18n pin to e56d262 (#7319)
* i18n: move the craft-i18n pin to e56d262

Brings in the translations merged to craft-i18n since the last pin.
The flatpak manifests name the same commit.

* i18n: read the newer catalog's rows in three UI tests

The craft-i18n pin brings French rows for the hotbar settings button and
its search field, a reworded German password warning, and French rows
that keep the source's menu-path arrow. The hotbar and script-prompt
tests now take those strings from the catalog. The font coverage test
still checks every letter, and skips a symbol only when the row's English
text has it too.

---------

Co-authored-by: FredApps <[email protected]>
2026-11-14 22:26:17 +01:00
FredApps 961bda29f1 CI: preserve font notice regressions through shared gate (#7218) 2026-11-14 22:26:12 +01:00
FredApps 1a5cf6b023 fix(ui): distinguish insert text annotation icon (#7170) 2026-11-14 22:26:03 +01:00
FredApps 5f8cc76cd0 fix(create): export JPEG images behind stream filters (#7168) 2026-11-14 22:25:58 +01:00
FredApps 54b91598a3 Move selected comments together with arrow keys (#7165)
* Move selected comments together with arrow keys

* Test keyboard nudging of selected lines

* test(ui): cover locked and duplicate nudge selections
2026-11-14 22:25:50 +01:00
FredApps a98744974a redact: an entry of /Annots that names another type does not block Apply
A graphics state or a font listed in /Annots (PDFBOX-5775 Export.pdf)
has no /Rect, so Apply refused and pointed at an annotation that is not
there. Such an entry is kept and skipped. One with an annotation
subtype is still an annotation whatever its /Type says, and still
refuses without a readable /Rect.
2026-11-14 21:32:15 +01:00
FredApps 346d803080 Merge pull request #7203 from christianlappin/fix/7050-macos-save-xattrs
Fix macOS saves for PDFs with extended attributes
2026-11-14 17:13:09 +01:00
358e33a307 M7: replacing a line keeps the source font for the words it can show (#2378, re-lands #2955) (#6842)
* M7: replacing a line keeps the source font for the words it can show (#2378) (#2955)

* Fit #2955's line edit to #4514's /ActualText spaces

Since #4514, source_show wraps a run whose spaces the subset lacks in a
/Span /ActualText BDC ... EMC, so the moves standing in for those spaces
read back. #2955's two-font /PCEdLine path writes its source runs through
source_show, so they now carry that span too. Three of its tests were
written against the operator stream from before that:

- replacing_a_mixed_font_line_again_replaces_its_sequence counted BMC and
  EMC as the /PCEdLine sequences alone. It now also counts each edit's
  own /ActualText spans (BDC, and EMC = sequences + spans), so a sequence
  that nests or survives a re-edit still fails it.
- a_leading_space_does_not_make_a_source_font_run looked for the leading
  move right after the Tf; it now sits inside the run's span.
- a_row_replaced_inside_a_shared_sequence_starts_in_its_own_font put its
  second row before the first EMC, which is now the span's: the row was
  read as part of the span's text. It now goes before the EMC that closes
  /PCEdLine, the case the test describes. A paragraph rewrite drops an
  /ActualText span with its line (the span's BDC and EMC are among the
  line's operators), so it never leaves a row inside one.

The code needs no change: re-editing drops the spans inside a /PCEdLine
sequence with it (BDC/EMC are in the dropped set), and a span's merged
run keeps the sequence it is in, so the line still reads back as one.
Also drops the same_font import lines.rs no longer uses.

* Tests: fit #2955's three line-edit tests to #4514's /ActualText spans

* Tests: the replaced sequence's check allows the new text's own /ActualText span

---------

Co-authored-by: mtlcl410 <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-11-14 13:25:27 +01:00
FredApps dd6c625274 Merge pull request #4417 from FredApps/fix/sonar-fonts-quality-gate
fix(ci): use pinned fonts for Sonar coverage
2026-11-14 12:16:14 +01:00
FredApps e2c90c33cb sonarcloud: use the craft-fonts commit the gate and the release use 2026-11-13 20:53:28 +01:00
FredApps 616c71492d Merge branch 'main' into fix/sonar-fonts-quality-gate 2026-11-13 20:43:14 +01:00
FredApps 0f22627bff Merge pull request #7144 from FredApps/port-2081
Link JavaScript actions and app.openDoc (port of #2081)
2026-11-13 19:47:48 +01:00
FredApps 0aed40d670 Merge branch 'main' into port-2081 2026-11-13 19:45:32 +01:00
FredApps c83c9ddb90 Merge pull request #7202 from Ethunxxx/fix/recent-reveal-test-race
test(ui): run the Home recent Reveal test inline so its toast check can't race
2026-11-13 19:45:11 +01:00
FredApps 2a639868dd Merge branch 'main' into port-2081 2026-11-13 18:59:56 +01:00
FredApps 1771844b84 fix(link-js): address the review on the #2081 port
- A link that fails puts the realm's timers back as they were before its
  own script ran, and turns no layer: timers it set are dropped, timers it
  cleared come back (timers::save/restore in Realm::run_job).
- In a read-only document a link's requests still apply when its field
  changes can't; the outcome carries the read-only error.
- app.openDoc during a calculation (calculateNow) is noted on the console
  and not queued, as for a field script running on its own.
- Link script streams are decoded once per stream, whatever their source
  length, and /Filter [] reads as the raw source.
- The web build sets the view's zoom, page and highlight before a link
  script runs, as the desktop does.
2026-11-13 18:48:33 +01:00
FredApps 8034990072 Merge pull request #7141 from FredApps/fix-openssl-ia32cap
fix(startup): an OPENSSL_ia32cap naming a missing CPU feature no longer stops PdfCraft (#2916)
2026-11-13 17:31:17 +01:00
FredApps ec31c55763 fix(ocr): main builds on Windows again: the executable check is its own function per platform (#7222)
Since Rust 1.100, clippy's needless_bool refused program_is_executable on Windows: with the
#[cfg(unix)] block gone it read if ... { return false; } true, and the Windows gate failed on
every main commit since 13 Nov 09:38. The check is now one expression with the platform part
in has_execute_permission; behaviour is unchanged on every platform.
2026-11-13 16:28:29 +01:00
FredApps e6730be289 test: scope CPU override regressions to supported platforms 2026-11-13 14:08:57 +01:00
FredApps fd4d60ff4a CI: use the shared git-sources check (#7042)
ci.yml ran its own copy of the git-sources job; it now calls
craft-common-actions git-sources.yml, under the same full-ci label rule.
2026-11-13 14:04:39 +01:00
FredApps 0c15e3de71 Merge pull request #7115 from jonathanwxh-cell/fix/measure-compound-number-formats
fix(measure): read compound and fractional measurement number formats (ISO 32000-2 12.9.2)
2026-11-13 10:38:39 +01:00
FredApps 623c53f887 Merge pull request #7073 from mtlcl410/fix/test-moddate-second-boundary
fix(tests): saves compared byte for byte don't fail when the clock crosses a second between them
2026-11-13 10:37:57 +01:00
FredApps eb2a2eddac Merge pull request #7056 from mtlcl410/perf/form-edit-reads-fields-once
M7: a form edit reads the document's fields once (form.fill-text)
2026-11-13 10:37:09 +01:00
FredApps a080e1ff27 Merge pull request #7053 from mtlcl410/fix/lone-sign-token
fix(hayro-syntax): a lone sign in a dictionary or array is unreadable, not a panic
2026-11-13 10:32:49 +01:00
FredApps 6d2c006f02 Merge pull request #7051 from mtlcl410/fix/js-session-test-worker-cap
fix(js): each unit-test thread counts its own document script workers
2026-11-13 10:29:31 +01:00
FredApps 330cde8035 Merge pull request #5559 from vangel76/feat/recent-reveal-5452
Reveal recent files in the system file manager from Home (#5452)
2026-11-13 02:19:00 +01:00
FredApps ad153f5ded test(ui): the link test's openDoc path is absolute on Windows too 2026-11-12 21:22:55 +01:00
FredApps feec1853c0 Merge main into port-2081
Main now has page actions, timers and layers (#6985) and shared text
allowances for inspection (#6015). Conflicts:
- render/inspect/annotations.rs: main's collect_link (which notes
  JavaScript even when the link isn't listed) takes this branch's link
  script budget and its once-only warning; push_link is gone.
- automation form_tools.rs, js tests.rs, docs/acroform-script-workflows.md:
  both sides added at the same place; both kept.
Adapted to main: the link runner's Job gets `timer: None`, and, as a
button's script does, the document's layers and the fields as page
actions and timers show them (live_state).
2026-11-12 20:53:37 +01:00
FredApps be9fe433cc Merge pull request #6985 from FredApps/port-4751
feat: LaTeX animate playback — page actions, timers, getOCGs, view-only overrides (port of #4751)
2026-11-12 20:30:31 +01:00
FredApps 5a53828c70 fix(startup): detect aws-lc's CPU features at start, as before 2026-11-12 19:39:12 +01:00
FredApps d0ab739f30 style: wrap the dropped-OPENSSL_ia32cap log line for rustfmt 2026-11-12 19:35:17 +01:00
FredApps bffa2d58c0 fix(scripts): a batch the redaction checks refuse discards its script globals
After the edit ran, a batch can still fail the redaction checks: a
deleted marked page alongside added pages, or text still shown under a
mark. Both returned without discard_edit_callbacks, so globals (and now
timers) the batch's field scripts left stayed in the document's realm
while the document rolled back. Every other refusal after the edit
already discards them.

Test: a_batch_a_redaction_check_refuses_discards_callback_globals. A
keystroke script sets a global, and a batch that sets the field and
deletes the marked page while adding one is refused. Without the fix the
global is still there ("number" for "undefined").
2026-11-12 19:27:38 +01:00
FredApps f52c6d8555 fix(startup): an OPENSSL_ia32cap naming a missing CPU feature no longer stops PdfCraft (#2916) 2026-11-12 18:53:52 +01:00
FredApps 522fa442f5 Merge main into port-4751
vendor/README.md conflicted: main took hayro-interpret patch 104 (RGB
colours in isolated DeviceCMYK groups). This branch's viewer overrides
become patches 105 (annotation_overrides) and 106 (appearance_overrides)
in the README, in vendor/hayro-interpret/src/interpret/mod.rs, in the
raster test and in docs/acroform-script-workflows.md.
2026-11-12 18:15:19 +01:00
FredApps 8c99ec4e08 CI: nightly release dry run (#7040)
release.yml also runs nightly on main with craft-common-actions' dry-run: every release build
except macOS, with nothing signed, pushed or drafted. Breakage that only the release build hits
(riscv64, Flatpak, FreeBSD, packaging) then shows up the next morning instead of on release
day, as it did on 11 Nov 2026.
2026-11-11 23:04:31 +01:00
FredApps ee081d033e fix(scripts): keep timers past a refused script; page actions before timers
A script refused before it runs (too long, or nested too deeply) left the
realm untouched but reported no timers. The viewer keeps only the timers
a run reports, so a button or console script over the limit stopped every
page timer. The realm now reports the timers it still has on that path.

The viewer built the page actions' run and the timers' run before it
handled either, so a due timer ran before what the page's open action
asked for: on a page that goes on to another, before that page's close
action could stop it. The timers now run after the page actions, and only
if those left the page, the tab and the dialogs as they were; otherwise
they wait a frame. The focused field's editor text is taken before each
run, not once for both.

Tests: a_script_refused_before_it_runs_reports_the_realms_timers (js),
a_script_refused_before_it_runs_keeps_the_pages_timers (engine),
timers_wait_for_the_page_a_page_action_goes_to (ui). Each fails without
its fix.
2026-11-11 19:48:17 +01:00
FredApps 3650f01f23 Release: PdfCraft v0.21.0 (#6995) 2026-11-11 17:58:30 +01:00
FredApps 223c1f02d4 fix(scripts): review fixes for page actions and timers
- A page action or timer whose edits are refused shows nothing it did:
  view changes go in only after apply_script_outcome accepts them.
- js_advance runs at most its 6,000-run cap; the last call only moves
  the clock (Session::run_timers_at_most).
- Field callbacks see the document's layers (getOCGs), also after a
  batch rebuilds the runner.
- The viewer's hit test uses what scripts show (shown_by_scripts): a
  frame they showed takes presses, one they hid doesn't.
- Print previews draw without the live annotation and appearance
  overrides.
- An appearance override naming no form (a cleared icon) draws nothing
  instead of the button's own face (hayro patch 105).
- Page actions and timers wait while a dialog or prompt is open.
- A timer editing the focused field refreshes its untouched draft.
2026-11-11 15:53:02 +01:00
FredApps 2c39b1d625 Merge pull request #6882 from Piohrun/fix/redact-unparsed-bytes
M8: redaction refuses a page whose content it can't fully parse
2026-11-11 14:40:29 +01:00
FredApps 96590430d4 Merge pull request #6935 from Piohrun/feat/optimize-mono-past-80-megapixels
M11: Optimize stores one-bit images and masks past 80 million pixels as monochrome images
2026-11-11 14:38:39 +01:00
FredApps 203c4fd8fa Merge pull request #6927 from Piohrun/fix/redact-marked-content-last-operands
M8: redaction reads an operator's operands from the end, as the renderer does
2026-11-11 14:38:05 +01:00
FredApps 209bb40d88 Merge pull request #6886 from Piohrun/fix/redact-form-matrix-by-reference
M8: the redaction walk reads a form's /Matrix entries by reference
2026-11-11 14:37:09 +01:00
FredApps 825ba80eac Merge pull request #6860 from Piohrun/fix/redact-type3-check-first
M8: the Type 3 cleanup charges the page only when there is a Type 3 font
2026-11-11 14:36:10 +01:00
FredApps b363f7a717 Merge pull request #6825 from Piohrun/feat/optimize-mono-masks
M11: Optimize stores a picture's one-bit masks as monochrome images
2026-11-11 14:35:24 +01:00
FredApps 22974ca874 Merge pull request #6813 from Piohrun/fix/fonts-refusal-counted
M7: a font's metrics are past their allowance only when it refused a read
2026-11-11 14:34:48 +01:00
FredApps 43e3eb62bd Merge remote-tracking branch 'origin/main' into port-2081
# Conflicts:
#	crates/automation/src/a11y/form_tools.rs
#	crates/engine/src/lib.rs
#	crates/js/src/tests.rs
2026-11-11 13:32:54 +01:00
FredAppsandPeter Yatsyshin 80d7de6698 test(ui): keep the mouse-down button inside the window
Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 13:25:18 +01:00
FredAppsandLMatt08 12bc215e12 docs: link JavaScript actions and app.openDoc (#2081 port)
Co-authored-by: LMatt08 <[email protected]>
2026-11-11 13:12:58 +01:00
FredAppsandPeter Yatsyshin 0fba511e97 forms: a push button with only a mouse-down action takes the press
Widget.mouse_down records an /AA /D action, so a push button acting only on mouse down (the
LaTeX animate package's controls) is pressable and its press runs the action as Mouse Down
through the widget trigger dispatch, instead of saying it has no action.

Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 13:11:32 +01:00
FredApps c0f5f92b57 Merge remote-tracking branch 'origin/main' into port-4751
# Conflicts:
#	crates/automation/src/dispatch.rs
#	crates/automation/src/tools.rs
#	crates/forms/src/lib.rs
#	crates/js/src/tests.rs
#	crates/ui-egui/src/workflows/js_ui.rs
#	parity/acrobat-features.toml
2026-11-11 13:11:32 +01:00
FredAppsandDWAA1660 059dbd6e00 feat(forms): open, Will Save and Will Print actions, widget pointer/focus scripts, setItems/setAction/toSource (port of #344) (#6969)
* feat(js, forms): field setItems, setAction and a bounded toSource (#269)

Ported from #344 by @DWAA1660 onto the per-document script session.

- `field.setItems(items)` replaces a combo or list box's items (text, or
  [text, export] pairs). The value stays when an item still has it, and
  otherwise becomes the first item's. Written as the field's /Opt (pairs
  only where the export value differs), /I dropped, field redrawn.
- `field.setAction(trigger, script)` installs a JavaScript action for one
  trigger (MouseUp/Down/Enter/Exit, OnFocus/OnBlur, Keystroke, Validate,
  Calculate, Format), replacing only that trigger's action.
- `Object.prototype.toSource()` writes plain data (strings, numbers,
  booleans, null, undefined, arrays, objects) that eval reads back. It
  refuses functions, cycles, more than 64 levels, 10,000 values or 1 MiB
  with an error the script can catch.

Co-authored-by: DWAA1660 <[email protected]>

* feat(engine): run a form's open, Will Save and Will Print actions and its widgets' pointer and focus scripts (#269)

Ported from #344 by @DWAA1660 onto the per-document script session: each
runs in the document's retained realm, so state the document scripts and
earlier events left is kept.

- The catalog /OpenAction's JavaScript (and its /Next chain, bounded and
  cycle-safe; other action types skipped) runs once on opening, after the
  document scripts, for background opens and reloads too, and again on
  Revert in a fresh realm. Event Doc/Open.
- `Session::run_document_actions` runs /AA /WS (Will Save) or /AA /WP
  (Will Print). A failing action is reported and never stops the save or
  print. doc_save and doc_print run them first and report what they said
  (`will_save`, `will_print`).
- Scripts that run unasked (open, Will Save, Will Print, pointer over,
  focus) may only ask for highlight, zoom, focus or a page; a click's
  Mouse Down / Mouse Up keep their requests.
- `Session::field_trigger` runs a widget's Mouse Enter, Mouse Exit, Mouse
  Down, Mouse Up, Focus or Blur JavaScript (one undoable edit), reading only
  that widget's dictionary. `field_focus` now runs an AcroForm widget's On
  Focus / On Blur as well as XFA enter/exit.
- New tool `js_event`; form_focus's description says AcroForm focus
  scripts run too.

Co-authored-by: DWAA1660 <[email protected]>

* feat(ui): Will Save before saving, Will Print before printing, and widget pointer scripts in the app (#269, #247)

Ported from #344 by @DWAA1660.

- Save (both paths) runs the document's Will Save actions first, and Print
  its Will Print actions; what they change is saved or printed, and what
  they say is shown.
- The pointer moving onto or off a form widget queues its Mouse Enter /
  Mouse Exit script, a press its Mouse Down. A click on a check box or radio
  button queues its Mouse Up after the toggle, so the script reads the value
  the click stored (#247). The queue runs after the frame's edit.

Co-authored-by: DWAA1660 <[email protected]>

* docs(parity): document actions and widget triggers are partly supported (#269)

Co-authored-by: DWAA1660 <[email protected]>

* test: check toSource's text (scripts can't eval it) and the trigger event names (#269)

Co-authored-by: DWAA1660 <[email protected]>

* test: a check box's Mouse Up reads its new value; keep the fixtures on screen and the realm across an in-place save (#247, #269)

Co-authored-by: DWAA1660 <[email protected]>

* fix(engine, forms, js, ui): review fixes for document actions and field triggers

- widget trigger actions follow /Next, each action its own edit; errors don't stop the chain
- setAction installs on the field the object stands for when names repeat
- toSource refuses non-plain objects and a __proto__ key
- doc_print checks the destination before Will Print; js_event returns only its own output
- combo/list clicks run Mouse Up; a refused click's Mouse Up doesn't run
- label crops are re-read when Will Print changed the document

Co-authored-by: DWAA1660 <[email protected]>

* forms: run a pointer trigger on the field it hit and refresh the edited field's draft

A trigger now carries the field's object, so of fields sharing a name the one under the
pointer runs its own script (Session::field_trigger_target); js_event passes the field it
resolved. A trigger script changing the field being edited shows in its editor unless the
user already typed there, as focus scripts do.

Co-authored-by: DWAA1660 <[email protected]>

* forms: carry the field's identity through focus scripts and js_event

Focus transitions now track the field object, so moving between fields sharing a name is a
move and the field that gained or lost focus runs its own script
(Session::field_focus_target). js_event takes an optional field_id from form_fields to pick
one of fields sharing a name.

Co-authored-by: DWAA1660 <[email protected]>

---------

Co-authored-by: DWAA1660 <[email protected]>
2026-11-11 13:09:37 +01:00
FredAppsandLMatt08 c6646e3469 ui: clicking a JavaScript link runs its action; openDoc asks first
Ported from #2081 onto main's script prompt UI: a JavaScript link click starts the link's
action like a button's (menus and questions without blocking the window; a failed one
changes nothing); its tip reads "JavaScript action"; app.openDoc queues the existing
consent prompt for another PDF (web: unavailable). No new strings.

Co-authored-by: LMatt08 <[email protected]>
2026-11-11 13:07:19 +01:00
FredAppsandLMatt08 e47e9fbc5e automation: link_run_javascript, open_doc requests, links' JavaScript in doc_info
Ported from #2081 on main's ScriptSession: link_run_javascript runs a link's action with
ordered answers (as js_run takes them) and reports its requests without carrying them out.

Co-authored-by: LMatt08 <[email protected]>
2026-11-11 12:55:47 +01:00
FredAppsandLMatt08 52ca67c8c4 engine: run a link's JavaScript action in the document realm
Ported from #2081: Session::run_link_javascript / start_link_javascript run a link's action as
event Link/Mouse Up on its page, with the document as target, in the per-document
ScriptSession; a failed link commits no field change or request; read-only documents' links
run too. Field scripts may not open another document; resolve_javascript_document_path
resolves openDoc paths as remote-link paths (Acrobat /C/... paths on Windows).

Co-authored-by: LMatt08 <[email protected]>
2026-11-11 12:43:21 +01:00
FredAppsandLMatt08 d9c895a32f js: app.openDoc request, a link event's document target, empty popUpMenuEx
Ported from #2081: app.openDoc only queues Request::OpenDoc for the current document's
folder (the viewer asks first) and answers null; a Link event's target is the document;
a popup menu with no items answers null without asking.

Co-authored-by: LMatt08 <[email protected]>
2026-11-11 12:32:31 +01:00
FredAppsandLMatt08 6d03a7acdf render: read a link's JavaScript action as LinkTarget::JavaScript
Ported from #2081: link annotations whose action is JavaScript keep the script (up to 256 KiB
each, 4 MiB per document; larger ones are rejected and reported once).

Co-authored-by: LMatt08 <[email protected]>
2026-11-11 12:32:31 +01:00
FredAppsandPeter Yatsyshin 6805790536 test(js): assert! for a bool (clippy)
Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 11:46:10 +01:00
FredAppsandPeter Yatsyshin 65ea96da4c style: fmt and a type alias for clippy
Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 11:37:07 +01:00
FredAppsandPeter Yatsyshin 96bcdfec1a feat(automation): js_page and js_advance; parity and docs for page actions and timers (#169)
Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 11:24:39 +01:00
FredAppsandPeter Yatsyshin d9ced67896 feat(ui): run the reading page's actions and timers each frame; highlight skips push buttons (#169)
Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 11:22:32 +01:00
FredAppsandPeter Yatsyshin 17ae6ec9cd feat(engine): page actions and timers run in the document realm and change only the view (#169)
show_page runs a page's close/open actions, run_timers fires due timers (at most 16 a call),
next_timer and script_clock drive the viewer. Fields they show, hide or give another icon
are drawn so on screen only (screen_config); values and resets are undoable edits. A timer's
alerts and requests go to the console. getOCGs layer changes turn layers as the panel does.

Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 11:22:32 +01:00
FredAppsandPeter Yatsyshin 85020ab05f feat(render): view-only annotation visibility and appearance overrides (hayro-interpret patches 104, 105) (#169)
Co-authored-by: Peter Yatsyshin <[email protected]>
2026-11-11 10:49:37 +01:00