Commit Graph
1469 Commits
Author SHA1 Message Date
Marco ArnulfoandFredApps 640ce697e8 M11: show art, trim and bleed boxes on the page (view.show-page-boxes) (#2779)
* M11: show art, trim and bleed boxes on the page (view.show-page-boxes)

Preferences > Documents and view outlines the bleed, trim and art boxes a
page sets, as Acrobat's Page Display preference does: only boxes the page
defines, clipped to the media box, placed through the crop box and /Rotate
and cut at the page edge. Art red, trim green, bleed blue, the colours of
Acrobat's Set Page Boxes > Show All Boxes. Remembered across restarts,
page-boxes on|off on the command line and control channel.

* Fix page box preference test selection

* Keep page box options in sync and mark box edges by type

---------

Co-authored-by: FredApps <[email protected]>
2026-12-04 14:34:13 +01:00
ad27770a23 fix(ui): the watermark and background previews show a file's picture (#2817) (#8679)
* fix(ui): the watermark and background previews show a file's picture (#2817)

The Add Watermark and Add Background dialogs previewed a mark taken
from a file (an image, or a page of a PDF) as a grey frame with the
file name, so its size, offset, turn and opacity could not be judged
before OK. The preview now draws the picture itself, where OK puts it.

The engine's new mark_picture brings the file in the way OK does
(mark_source: an image turned upright by its EXIF orientation, a PDF
page as an upright form), draws it alone on a page of its shape and
renders it small, once on white paper and once over black, so its own
transparency survives. The dialog renders it on a worker thread, keeps
it in the draft as a texture keyed by the file and the page, and shows
the frame with the file name until it arrives or when the file can't
be drawn. It is laid out as picture() in pdfcraft-edit lays it out:
fitted to the page at the scale, centred plus the offset, turned, at
the opacity. A watermark on top is drawn over the page. A background,
or a watermark behind the page, shows where the page is white: the
page's picture is multiplied by the picture, averaged over a fine
grid, as a background colour already tints it.

Item 14 of #2817.

* deps: ctutils 0.4.5 for RUSTSEC-2026-0385

* parity: evidence paths where main moved the tests (tests/it/)

* style: cargo fmt after the merge

* engine: the picture sheet's black background has no backdrop to replace (main's new Background field)

* engine: the mark-picture tests encode their PNGs with craft-image-codecs, as the engine does since main dropped the png crate

* fix(ui): a file background previews nowhere the page's own backdrop hides it

The colour tint already left out pages that keep their backdrop: a scan, or a
white backdrop with Replace unticked. The picture did not, so the preview
showed a background OK would not. backdrop_hides is now the one test both use,
and such a page previews with no picture at all.

The new test fails with the check removed ("page 1 keeps its backdrop").

Raised by CodeRabbit on #3024.

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

* fix(ui): a mark from a file is clipped at the page edge in the preview

OK crops a watermark or background at the page edge, but the preview drew it
under the pane's clip, so a scaled, offset or turned mark ran past the page
into the pane. It is now drawn with the clip narrowed to the page.

The test uses the landscape page, where the pane is taller than the page, and
fails with the clip removed.

Raised by CodeRabbit on #3024.

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

* fix(ui): a picture behind the page shows only where the page paints nothing

The watermark and background previews drew a file's picture behind the
page by tinting the page picture with it, so the page's own colours were
multiplied by the picture: an opaque blue box over a red picture previewed
black, though after OK it stays blue.

The preview now paints white paper, the picture, then the page rendered
on a transparent sheet (Document::pages_on_glass), which is clear only
where the page paints nothing. The sheet drops the marks an Update
replaces and, for a background with Replace ticked, the white backdrops
OK replaces. Until the sheet is rendered nothing is drawn behind the
page. The per-cell averaging grid the tint needed goes.

a_picture_behind_the_page_is_covered_where_the_page_paints reads what
the preview's meshes show at the box: with the old preview it fails
(#00_00_00_FF, black). the_pages_on_glass_are_clear_only_where_they_paint_nothing
fails with the sheet rendered opaque (alpha 255 on bare paper).

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

* fix(ui): render a page sheet only at a positive, finite scale

A zero, negative or non-finite preview scale no longer reaches
render_page: glass_scale refuses it and the picture behind the page
is simply not drawn. The engine gains a test that pages_on_glass with
replace_backdrops takes a page's own white backdrop away.

Revert proof: with glass_scale returning Some for every scale,
a_sheet_is_rendered_only_at_a_positive_finite_scale fails (Some(0)
for 0.0); with replace_backdrops ignored,
the_pages_on_glass_lose_the_white_backdrop_a_background_replaces
fails (alpha 255 on bare paper).

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

* test(ui): read mesh triangles with as_chunks

Clippy on the CI toolchain rejects chunks_exact with a constant size.

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

* fix(ui): show the file name while a picture's page sheet is missing

A picture placed behind the page draws on the page's transparent sheet.
While that sheet renders, or when it can't be rendered, the preview fell
back to Layer::Hidden and drew nothing, the same as a mark the page's own
backdrop hides. The user saw no sign of the picture they had chosen.

file_layer now returns None when the sheet is missing, so the overlay
takes its name-frame arm. A picture the backdrop hides is still not drawn,
and asks for no sheet. The sheet is rendered only when there is a picture.

Test: a_picture_behind_a_page_whose_sheet_is_missing_shows_the_file_name_frame.

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

* Format marks_ui.rs after the merge with main

rustfmt joins the overlay() signature onto one line (the merge with main left it split).

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

---------

Co-authored-by: Guillem Hermida <[email protected]>
Co-authored-by: KenM76 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-12-04 14:23:37 +01:00
a8176e3194 M5: change the text range a highlight, underline, strikethrough or squiggly marks (#4824) (#8555)
* M5: change the text range a highlight, underline, strikethrough or squiggly marks (#4824)

pdfcraft_annot::set_quads and Edit::SetMarkupRange give an existing text markup
new quadrilaterals (colour, note and replies kept, one undo step). The comment
context menu gets Mark the selected text instead, and comment_edit takes
find/all/quads. Appearance redraws read indirect /CA, /C and friends, and a
squiggly's zigzag has a total vertex budget.

* M5: refuse empty markup quadrilaterals before changing comments (#4824)

* M5: check markup refusals before promoting inline annotations (#4824)

* M5: keep every squiggly area zigzagged within its drawing budget (#4824)

* M5: refuse markup redraws before promoting inline annotations (#4824)

* M5: fit the markup range tests to main and list comment_edit for highlights (#4824)

The rebase onto main left two tests on APIs main has since changed:
appearance::build now takes the document, and the UI test selects a
comment through session.comments.select_only and runs commands, options
and undo through the harness helpers. The comment.highlight parity entry
now also lists comment_edit, which changes a highlight's marked text.

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

* M5: check restyles before promotion and store quads in drawing order (#4824)

set_style checks the target and every Replace Text partner before
annot_ref can promote an inline annotation, so a refused restyle (one
too large to redraw, one that cannot be drawn, one locked) adds no
object and leaves /Annots as it was. A partner the change leaves alone
(a strikeout under a width-only restyle) is still checked for its lock
only.

set_quads stores corners given around the area (ISO 32000-2 §12.5.6.10,
Table 182) in the order the appearance draws, so a highlight fills its
area instead of crossing itself; a quad whose first two corners are
opposite each other is refused.

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

* M5: compare signs when testing a quad's outline for crossings (#4824)

z_order multiplied two side values to test whether an edge pair
crosses. For a tiny quad (edges near 1e-100) the product underflows
to zero, the crossing goes unseen and a perimeter-order quad is stored
unchanged. Compare the signs of the two values instead.

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

---------

Co-authored-by: Adrian <[email protected]>
Co-authored-by: KenM76 <KenM76>
Co-authored-by: AdrianTM <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: KenM76 <[email protected]>
2026-12-04 14:13:56 +01:00
FredApps aac23fb4d8 Merge pull request #8591 from KenM76/feat/bates-files-dialog
Add Bates numbering to a list of files from the app
2026-12-04 13:37:05 +01:00
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
FredApps ec828d0093 Merge branch 'main' into feat/bates-files-dialog 2026-12-04 12:54:56 +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
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
KenM76andClaude Opus 5.5 a63cdcfede feat(ui): add Bates numbering to a list of files from the app
Bates numbering > Add to files... (edit.bates_files) numbers a list of
files as one run: each file starts one after the last number of the file
before, with the single-file token's prefix, suffix, digits, start and box.
It writes numbered copies beside each original or in a picked folder and
never changes the originals. Nothing is written when a copy would land on
another copy (names compared without case) or on an existing file, or when
a file can't be read, opened (password, signed) or numbered.

The engine gains BatesFormat (check, spans with checked arithmetic, label,
settings) and Session::add_bates. doc_bates_multi is not moved onto it
here; that move is its own change.

Parity edit.bates-multi-file stays partial: the dialog refuses password
and signed files and runs on the frame thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-28 04:27:06 -05: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