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.
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]>
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.
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.
- `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]>
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]>
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).
With marks, a page the marks would widen past 14,400 pt was refused only after the
document's Will Print actions ran, so their field change stayed behind a print that
failed. Session::check_printer_marks runs the mark editor on a scratch copy first;
doc_print calls it before Will Print, and the print still adds the marks after it.
Main split organize/src/import.rs into import/{carry,combine,copy,fields}.rs and already made set_attachments UTF-16-safe and indirect-/Names-safe (this PR's other two hunks), so those take main's version. Ported the PR's core change: insert_file_pages now merges the source's catalog attachments via carry::collect_attachments + attachments::entries (made pub(crate)) + set_attachments. PR's engine regression test file kept as-is; parity evidence/notes merged onto main's entries (it/ paths); ROADMAP/docs entries added to main's text. cargo check -p pdfcraft-organize -p pdfcraft-engine --tests passes locally.
Brings the branch onto the craft framework UI port (#8160) and the CI
follow-ups after it.
script_dialog.rs: poll_script_dialog keeps main's shape (DocView's zoom()
and current() accessors, the pending `dialog` in place of `prompt`, and
close_script_prompt before discarding or timing out) and carries the PR's
XFA handling over unchanged: an XFA click is not dropped when the view's
zoom or page changes, a dropped XFA click says why, and its no-prompt
backstop is 60 s instead of 10 s.
tests/it/xfa.rs: the PR's tests keep their assertions. The runaway-click
test waits with `until` and reads the notice through main's toast cards
(`says_scripts_are_off(&h)`), and the view-change test reads the zoom with
`zoom()` and sets it through `view.zoom`, as main's tests do.
Co-Authored-By: Claude Opus 5.5 <[email protected]>