Commit Graph
1511 Commits
Author SHA1 Message Date
FredApps 4b03632ebb Merge pull request #8558 from KenM76/feat/form-field-grid-copies
M6: copy a form field into a grid (#6012)
2026-12-04 13:35:45 +01:00
8db03bbe3f fix(ui): All tools ▸ Audit space usage opens the Space Audit (#8993) (#9004)
* fix(ui): All tools ▸ Audit space usage opens the Space Audit (#8993)

The Space Audit shipped (Document Properties ▸ Space Audit and the
Optimizer's button), but the Compress a PDF catalogue entry still said
Planned (M11) and had no command behind it. Register optimize.audit,
open the stand-alone Space Audit dialog from it, and mark the entry
Ready.

* fix(ui): the Space Audit shows only the active document's figures

A finished audit was written to the shared result whatever document it
measured, so a late audit of one document could replace another's, and
the dialog showed the previous document's rows while the new measure
ran. Take in a result only when it is the active document's at its
current edit generation, and clear the rows and say "Measuring…" until
that result arrives.

* fix(ui): the Space Audit dialog measures again after an edit lands mid-measure (#8993)

pass dropped a stale audit result but left space_audit_pending set, and only
the Properties tab starts a new measure, so the stand-alone and Optimizer audit
dialogs could stay on "Measuring..." with an empty table. Start the measure for
the current edit once when it is pending, the result is not for this edit and no
job exists for it, as Properties does. Adds a test that edits before the first
measure finishes.

Review: https://github.com/storytold/pdfcraft/pull/9004#pullrequestreview-6187726404

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: FredApps <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
2026-12-04 13:19:28 +01:00
FredApps 4f76f1af37 Merge branch 'main' into feat/form-field-grid-copies 2026-12-04 12:55:02 +01:00
bmh129andClaude Opus 5.5 116224fa72 fix(js): a value a script assigns with field.value is shown through the field's Format script (#9140) (#9141)
* fix(js): a value a script assigns with field.value is shown through the field's Format script (#9140)

Only Calculate results were marked for redrawing through the Format script, so a button that copied
138 into a currency field drew "138" instead of "$ 138.00". The field.value setter now marks the
field formatted as well; the stored value is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Rvu8dYQi7eW7nr4gjv2mgG

* fix(forms): a check box or radio button a script sets keeps its state appearances (#9140)

The Format redraw draws one text appearance and removes /AS, so a script assigning a check box's
value would have lost its on and off faces. Only text and combo boxes are redrawn through Format.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Rvu8dYQi7eW7nr4gjv2mgG

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-12-04 12:00:15 +01:00
40c0271fba Limit text comparison to selected pages (#6507)
* Limit text comparison to selected pages

Comparing every page is slow and noisy for large documents when only one page changed. Scoping the diff to chosen pages makes the result focused and faster.

Add an optional pages argument to doc_compare and Session::compare_pages that filters both documents' words to the listed 1-based pages before running the existing comparison, keeping Session::compare unchanged for all pages.

Test: compare_pages_limits_text_comparison failed before the change and passes after.

* Repair review branch integration

* Tighten the change after a final review

* Tighten the change after a final review

* Address review for pull request 6507

* Format the files this pull request changes

* Address remaining review requests

* Align compare and automation changes with the current main

* Format the deletion-mark regression test

* Address review for pull request 6507

* Repair review branch integration

* Repair review branch integration

* Update the annotation tests for the new Style, SaveOptions, LinkAction and Shape fields

* Format the files this pull request changes

* Format the files this pull request changes

* Select the compared pages in the split document tools and restore main's text elsewhere

* Drop the PDF/A verification test that belongs to another change

* Address review for pull request 6507

* Format the files this pull request changes

* Repair review branch integration

* Tighten the change after a final review

* Tighten the change after a final review

* Repair review branch integration

* Address review for pull request 6507

* Format the files this pull request changes

* Address review for pull request 6507

* Format the files this pull request changes

* Tighten the change after a final review

* Tighten the change after a final review

* Repair review branch integration

* Repair review branch integration

* Tighten the change after a final review

* Repair review branch integration

* Tighten the change after a final review

---------

Co-authored-by: eliets2 <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-12-04 11:14:53 +01:00
01eedd566c M5: All tools ▸ Add comments lists Attach file (#8172) (#8553)
The Add comments tool group did not list comment.attach, so the only
Attach file in All tools was Edit a PDF's, which attaches the file to
the document with no icon on any page. List the comment tool under
Add comments ▸ Markup, with the label and icon the quick toolbar
already uses.

The UI test opens Add comments, clicks the Attach file row, clicks the
page and answers the picker, and checks that a FileAttachment comment
sits at the clicked spot. It fails with the catalogue line removed.

Co-authored-by: KenM76 <KenM76>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-12-04 08:43:23 +01:00
Aleksander HelgakerandFredApps 255ea3724d fix(print): report dimensions of images inside forms (#7742) (#7748)
* fix(print): report dimensions of images inside forms

* fix(print): preserve low-PPI findings for shared and extreme image uses

* Keep print image measurements consistent across placements

* Measure direct image PPI after scaling by UserUnit

* Deduplicate direct image reports by placement origin

---------

Co-authored-by: FredApps <[email protected]>
2026-12-04 08:26:17 +01:00
Terra854andFredApps a9b6dc8737 Keep original PDF dates for comment timestamps (#8958) (#8978)
Co-authored-by: FredApps <[email protected]>
2026-12-04 08:02:34 +01:00
29d305d95d fix(print): tell CUPS how the marked sheets run (doc_print marks) (#9135)
* Print: tell CUPS how the marked sheets run

With printer marks, doc_print laid the sheets out from the pages as the
document shows them, while print_pdf_marked prints the pages the marks
widen. A page the marks widen from portrait to landscape was spooled
without orientation-requested 4, so CUPS would shrink its landscape sheet
onto portrait paper.

Session::check_printer_marks, the scratch-copy check that already runs
before Will Print, now returns each page's displayed size on that copy, and
doc_print lays the sheets out from them. The sheet count and the automatic
CUPS orientation follow the printed sheets, and nothing is rendered twice.
spool_job's argument checks still run before Will Print; an orientation in
options still stands, and a mixed job still gets none.

The marks test now also prints the same page at the same layout with and
without trim and registration marks, and checks for ink at a trim mark and
a registration target where the unmarked print has blank paper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Print: keep printed_sheets in the doc_print impl block

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SqmHYx8FiWM5PcsoiErgp9

---------

Co-authored-by: KenM76 <KenM76>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: KenM76 <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-12-04 06:40:58 +01:00
Elvis33LEandskylar taylor f785466336 test(ci): consolidate integration tests into tests/it across 6 crates (#9050)
* test(ci): consolidate integration tests into tests/it across 6 crates

* ci: update parity evidence paths for consolidated integration tests

---------

Co-authored-by: skylar taylor <[email protected]>
2026-12-02 15:17:52 -06:00
FredApps dcb2c569a5 Merge branch 'main' into feat/image-page-size 2026-12-02 07:41:28 +01:00
FredApps 2dd24dcdf9 Format with rustfmt after the main merge
Import lists in engine/src/lib.rs and session.rs reflow, and one blank line
goes from the automation tests; no other change.
2026-12-02 13:40:33 +07:00
FredApps 36f0150c42 Merge pull request #3069 from mtlcl410/feat/alpha-hit-testing
M7: pictures are picked where they show, not across their transparent margins (#3005)
2026-12-02 07:19:44 +01:00
FredApps dd90ee980d Merge branch 'main' into feat/alpha-hit-testing 2026-12-02 06:33:04 +01:00
FredApps ca74084fc9 Merge branch 'main' into fix/validate-rejected-value-reverts 2026-12-02 06:32:44 +01:00
FredApps a639547bc9 Merge branch 'main' into feat/image-page-size 2026-12-02 05:45:52 +01:00
FredApps e0580ebaad Merge branch 'main' into feat/sign-ca-checks-and-trust-sets 2026-12-02 05:45:46 +01:00
FredApps 016246e7fc Merge branch 'main' into fix/xfa-message-box-answers 2026-12-02 04:52:18 +01:00
FredApps 1034899e97 Merge branch 'main' into fix/merge-data-quoted-csv-7410 2026-12-02 02:07:03 +01:00
FredApps 74e2e3534d Merge branch 'main' into fix/header-footer-update-5785 2026-12-02 00:41:18 +01:00
jweaver3 7e6326eae5 M7.6: keep an updated header and footer in its place among the others
Update now puts the replacement where the header and footer it replaces
was on each page, instead of on top of every mark added after it, so
marks that overlap stack as they did. The preview draws the page in two
layers around the draft: the marks under it, then the ones over it on a
transparent page, so it still shows what OK will leave.
2026-11-30 07:28:15 -05:00
yusufmntmandClaude Opus 5.5 014f2c74c4 feat(edit): allow custom and Unicode fonts for added text (#4978)
Added text could only use the standard Helvetica, Times and Courier
faces, so characters outside WinAnsi (Greek, Cyrillic, CJK) were
refused. An added text item can now name a page font resource
(`AddedText::font_resource`): it is drawn with that embedded font
(Type 0, Identity-H, wrapped with the font's own advances), kept in
`/PCAdded` across saves, and painted in the item's ink like other text.

The Format text panel offers the page's document fonts, Load font… and
the installed fonts for added text as well as for edited paragraphs; a
pick or a loaded font applies to the draft, the selected added text
(undoable) or the style for the next text. Bold and italic are off for
an explicit font resource.

Rebased onto the craft framework UI port (#8160).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 13:25:28 +01:00
jweaver3 7ad1496871 Merge upstream main into fix/header-footer-update-5785
main replaced the marks dialogs with hosted parameter dialogs
(craft::ui::patterns::form_dialogs), so Update's header and footer
choice (#5785) is ported onto them rather than merged line by line:

- The "Which header and footer:" choice is a choice row (hf.which).
  Picking one fills the dialog in from it; whether the range is still
  the one it filled in travels in the dialog's fields (hf.range_kept),
  so the build pass, the host pass and OK all read the same pages.
- finish_marks refuses an Update read from another document, as
  finish_edits did.
- The page range is craft::pages::PageRange: the preview helpers take
  the pages OK applies to.

FredApps' review: the Update preview took away every header and footer
on the page (doc.without_marks), while OK removes only the chosen one,
so a header and footer OK keeps was missing from the preview. The
preview now takes away only the chosen one (new
Document::without_header_footer over pdfcraft_edit::remove_header_footer,
the removal update_header_footer itself does), and its cache is keyed
by the choice, so choosing another draws the page again. An older
header and footer with no recorded settings is still replaced
page-wide, and previewed that way.

Tests: an engine test and a dialog-level test with two headers and
footers on one page, unit tests for what the preview takes away and
for the fields, and the PR's two UI tests ported to the new harness.
2026-11-29 02:01:50 -05:00
FredApps d1e6a5374b Merge main into fix/merge-data-quoted-csv-7410
Preserve main CSV bytes and carry the distinct field count from the existing XFDF writer through the engine to form_merge_data. Keep the ordinary quoted and empty-header regressions.
2026-11-28 20:43:00 +01:00
FredApps 32dbecde2d Merge remote-tracking branch 'origin/main' into pr-6984
# Conflicts:
#	crates/automation/tests/it/automation.rs
#	crates/engine/src/edit/run.rs
#	crates/engine/src/open.rs
#	crates/engine/src/session/editing.rs
#	crates/engine/src/tests.rs
#	crates/engine/src/xfa.rs
#	crates/engine/src/xfa_form.rs
#	parity/acrobat-features.toml
2026-11-28 08:28:58 +07:00
01ecdf2c17 Grid copies: one export-value rule, keep a widget's read-only flag
A check box with several widgets is copyable only when every widget has
the same on state and the same export value. The forms layer's
`copyable_widget` now holds that rule and the engine's
`field_table::copyable` calls it, so the preview and the copy agree.
Before, a box whose widgets drew different on states without /Opt was
copied, and one whose /Opt repeated a single value was refused.

A copied check box gets its widget's export value as its /Opt when /Opt
lists one value per widget, and no /Opt otherwise, so the copy exports
what its source widget did.

A widget that is read-only through its own /Ff makes its copy read-only:
the copy has one dictionary, and the field's /Ff used to hide the
widget's.

The automation README and the parity note say which check boxes are
refused in the new rule's terms, and the parity entry lists the tests.

Co-authored-by: Karim <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 18:51:58 -05:00
Thorsten Hirsch 59707b8fac Merge branch 'storytold:main' into feat/sign-ca-checks-and-trust-sets 2026-11-28 00:39:19 +01:00
FredApps e48415fb05 Merge remote-tracking branch 'origin/main' into pr-3331
# Conflicts:
#	crates/automation/src/printing.rs
#	crates/automation/src/tools.rs
#	crates/automation/tests/it/automation.rs
#	crates/create/src/lib.rs
#	crates/create/src/tests.rs
#	crates/engine/src/lib.rs
#	crates/engine/src/session.rs
#	crates/engine/src/session/files.rs
2026-11-28 05:33:55 +07:00
FredApps 81a475e55f Merge pull request #6982 from Combiler01/fix/freehand-highlight-icon
Fix: Use a dedicated icon for Freehand Highlight (#6961)
2026-11-27 23:30:26 +01:00
cbe3eb63cb Copy into Grid: say why the item is off, test the tool's refusals
- The undo label is "Copy field into grid" and the parity title "Copy a
  field into a grid", so no other product's wording is left. The parity
  notes and the tool text say "value" rather than "initial value", and
  the notes drop "actions", which no test checks.
- form_add_field_table no longer repeats the text-or-check-box test:
  copy_edit refuses what field_table::copyable says no to, so the tool
  and the menu refuse the same fields with the same Uncopyable reason.
  The tool still checks the field and the widget exist.
- A disabled Copy into Grid... row says why on hover: several fields
  are selected, or the field is not a text field or a check box with
  one export value.
- New tests: the tool refuses source_widget without source_field, an
  unknown field, a radio group, source_widget 0 and a widget past the
  last, adding nothing; and the hostile-argument sweep sends every
  hostile value as source_widget, with and without source_field.

Co-authored-by: Karim <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 16:44:32 -05:00
mtlcl410 a70473b53f Merge remote-tracking branch 'upstream/main' into HEAD 2026-11-28 00:41:50 +08:00
9ecb1f8823 Grid copies: own appearances, no XFA keys, refuse what can't copy
Review fixes on #6012's copy_field and copy_edit:

- A copy no longer carries the source's private XFA keys (PCSom,
  PCXfaNode, PCItems), so it is not bound to the template node the
  source fills.
- Each copy gets appearance streams of its own (/N, /D, /R and every
  check box state). Shared streams meant redrawing one in place, as a
  password field's edit does, redrew the source and every other copy.
- copy_edit refuses a field a grid can't copy with
  TableError::Uncopyable, so a preview never shows a check box whose
  widgets export different values as valid. field_table::copyable is
  the same test for menus.
- copy_field is split into helpers under 80 lines.

New forms tests: a transparent, borderless, multi-line source keeps its
look and flag in the copy after a save; a copy has no PCSom; filling a
copy leaves the source's appearance stream unchanged. The check box test
now asserts a different stream with equal content per state.

Co-authored-by: Karim1125 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 09:38:48 -05:00
Karim 36b33e3363 M6: copy form fields into a grid
Cherry-picked from #6012 (ef57ba58d) onto main c34c6c5a0. Conflicts
resolved: CopyField sits beside main's field edits and clears the form
script snapshot like them; the copy label joins main's batch labels.
The Prepare a form menu and window parts are left out here because main
moved them onto the dialog host; the next commits port them. The
ROADMAP.md, docs/roadmap.md and docs/gaps.md edits are dropped.
2026-11-27 08:18:59 -05:00
Thorsten HirschandClaude Sonnet 5.5 4139499ec1 M9: review follow-ups: a trust list is known by its own name, a spliced PEM block is refused
- `TrustStore::set_list(name, Option<list>)` had two sources for a list's name: a list
  loaded as "EU" but named "Other" could not be removed as "EU". Now `add_list(list)`
  uses the list's own name and `remove_list(name)` takes it back (`Session::add_trust_list`,
  `remove_trust_list`).
- `x509::load_certificates` now refuses a PEM block that never ends (upstream, with the
  `.p7b` bundles). A block that begins while another is still open replaced it without a
  word, so a bundle spliced from two cut-short files loaded as the second one only. That is
  an error too; the trust list tests cover a cut inside the last block, a cut after the
  last complete one, and a splice.
- The module docs say why non-CA entries stay in a list: the real EU file has 4 of 875
  (three OCSP responder certificates, one time-stamp signer) under its CA services, so
  refusing them would refuse the real lists. They issue nothing in chain building and
  vouch only for themselves, which the signer checks still judge.

Fallout of rebasing onto the current main: the parity evidence follows the tests into
`tests/it/`, and twelve tests that others added build their `TrustStore` with
`..TrustStore::default()`.
Upstream's rule that a time-stamp authority's certificate must be issued for time
stamping would have kept the time untrusted in our time-stamp test for a second reason;
its authority now has that purpose, so the test checks our rule again (a list never
vouches for a time-stamp authority: it fails if one could) and the user's own
certificate still makes the time trusted. No catalog line and no attribution hash is
touched: upstream no longer gates tests on translations, and the new wording stays
English until translators get to it.

Fallout of rebasing onto the main of Nov 4: `validate.rs` now imports its names one by one, so
`TrustSource` is imported there, and the test time-stamp authority calls `timestamp::respond`
with its new `TimestampSigner` / `TimestampIssuance` arguments.

Fallout of rebasing onto the main of Nov 18: the x509 chain builder takes its pool as an iterator
(upstream now hashes a candidate's issuer once per lookup, which the iterator keeps), the
re-exports gain `TrustSource` next to upstream's `has_signatures`, and eleven more tests that
others added in `pdf.rs`, `encrypted_signing.rs`, `revision_classification.rs` and
`signed_structure.rs` build their `TrustStore` with `..TrustStore::default()`.

Fallout of rebasing onto the main of Nov 26: four more tests that others added in `pdf.rs`
build their `TrustStore` with `..TrustStore::default()`. The ROADMAP progress-log line is
dropped: it was the only file in conflict, and AGENTS.md asks not to edit append-only logs;
the same facts are in `crates/sign/README.md`, the module docs and the `sign.eutl` parity entry.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-26 23:49:04 +01:00
Thorsten HirschandClaude Sonnet 5.5 8e52c9c3c3 M9: opt-in trust lists (a file of CA certificates, such as the EU Trusted Lists)
A signer can be trusted through a list of CA certificates the user loads from a
file: `sign_trust {"eu_trusted_list": "<path>"}`, DER one after the other or
PEM. Refs #775, #87, #824: the PDF attached to #775, a CAdES signature under a
qualified service that Acrobat validates, is Unknown without the list and Valid
with it.

- The list is off until loaded, nothing is embedded, and it is kept apart from
  the user's own trusted certificates (`TrustStore::lists`). The details name the
  list that vouched. Chains through it still need CA certificates all the way
  (#620) and the signer's own certificate is held to #749's purpose rules.
- A list vouches for signers, never for a time-stamp authority: a CA trusted to
  issue signing certificates is not thereby a source of trusted time, so trusted
  time still comes from the user's own certificates.
- A cut-short or damaged list is refused instead of loading as a smaller one, and
  PEM that starts with text beginning with a "0" (DER's first byte) is read as PEM,
  in `x509::load_certificates` too.
- `sign_trust` reads and checks every argument before it changes anything and
  revalidates the open documents once (`Session::update_trust`); the list path
  stays inside `--root` and the read is bounded.
- `build_chain` takes its pool as an iterator, so a list's certificates are not
  copied for every signature.

`TrustStore` gains `lists`: struct literals need `..TrustStore::default()`.

Tests that fail without their change: the damaged-list and PEM cases
(`trust.rs`), a list that holds a time-stamp authority's certificate not making
its time trusted (`chain.rs`, with the shape of #775), and a bad `sign_trust`
argument changing nothing (`automation.rs`).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-26 23:46:04 +01:00
mtlcl410 c4c22df1b2 Merge main (d492d8890) into feat/alpha-hit-testing 2026-11-27 05:58:33 +08:00
FredApps f53cab766c Merge main into #4538 2026-11-26 20:27:19 +01:00
FredApps 1e05eefeae Merge main into #4369 2026-11-27 00:10:52 +07:00
FredApps e4144bfdde Merge main into #4538 2026-11-27 00:09:02 +07:00
FredApps e334d6d4be Merge pull request #4527 from EricKaden/fix/xfa-ready-events
XFA: ready events run in the other viewer's order, and layout:ready again after a new layout
2026-11-26 17:50:24 +01:00
FredApps d3428827db Merge pull request #2763 from kavishkashehan726-sudo/claude/serene-hawking-sk6w13
fix(engine): validate signed XFA forms as the file was read (#2759)
2026-11-26 17:37:19 +01:00
FredApps 328a1bca2b Merge main into #4538 2026-11-26 17:33:12 +01:00
FredApps 781ab07f8c Merge main into #4369 2026-11-26 23:23:46 +07:00
FredApps 0b47a83928 Merge main into #4527 2026-11-26 23:05:58 +07:00
FredApps c2bd7c14b7 Merge pull request #4604 from mtlcl410/fix/xfa-script-relayout-full-refresh
M12: an XFA form laid out again by its scripts rebuilds its pages in the view (#4603)
2026-11-26 16:51:38 +01:00
FredApps 8e8019a742 Format the click test's focus assertion 2026-11-26 16:49:37 +01:00
FredApps cd7b5cefd0 Merge main into #2763
main split the engine's lib.rs into modules; the as-opened validation is ported: Editor::as_opened and AsOpened in history.rs, editor_signatures in doc_state.rs (used wherever an editor's signatures are validated), the as-read capture in open.rs, and mark_saved clearing it in session/save.rs. The test also pins the saved status (dynamic Invalid, static Valid).
2026-11-26 22:46:38 +07:00
FredApps 9a1d2b4d37 Merge pull request #4551 from dotCooCoo/fix/automation-reports-form-script-errors
fix(automation): doc_open and form_fill report the errors of the form's scripts
2026-11-26 16:39:05 +01:00
FredApps 1c2a179a62 Fit the landed changes together: the click test expects main's FocusField request 2026-11-26 22:18:15 +07:00
FredApps 2ebe4e6ac3 Merge main into #4369 2026-11-26 22:14:30 +07:00