mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-29 09:44:51 +01:00
Merge main into #7704
docs/roadmap.md change-log table: kept this PR's 2026-11-18 row and main's new 2026-10-16 row.
This commit is contained in:
commit
ada013f042
6 files changed
+257
-9
No files matched your search
@@ -264,6 +264,7 @@ Ranked; detail and the full milestone table in [docs/roadmap.md](docs/roadmap.md
|
||||
| 8 | 1.0 polish: performance, right-to-left, missing languages, keyboard-only (M14) | 55–95 |
|
||||
|
||||
## Progress log
|
||||
- **2026-10-16 (M4, Insert from File):** Catalog attachments come along with inserted pages in the same undo step. Existing attachments and destination name trees stay; duplicate UTF-16 keys keep their encoding. Generated engine regressions cover save/undo/redo and failed-batch rollback. Estimates unchanged.
|
||||
|
||||
- **2026-11-18 (M7, #7687):** PDF-page watermarks clip the source CropBox to MediaBox before sizing and rotating the imported form. Synthetic geometry and save/reopen render regressions cover oversized and partially overlapping crops; estimates unchanged.
|
||||
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use pdfcraft_cos::{Dict, Document, Object, PdfString, SaveOptions, Stream, write_full};
|
||||
use pdfcraft_engine::{Edit, Session};
|
||||
use pdfcraft_organize::FieldConflicts;
|
||||
|
||||
fn dict<const N: usize>(entries: [(&str, Object); N]) -> Dict {
|
||||
let mut out = Dict::new();
|
||||
for (key, value) in entries {
|
||||
out.set(key.as_bytes().to_vec(), value);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
fn packet(title: &str, attachment_key: Option<Vec<u8>>, indirect_names: bool) -> Arc<Vec<u8>> {
|
||||
let mut doc = Document::new_empty();
|
||||
let pages = doc.add(Object::Null);
|
||||
let font = doc.add(dict([("Type", Object::name("Font")), ("Subtype", Object::name("Type1")), ("BaseFont", Object::name("Helvetica"))]));
|
||||
let body = format!("BT /F1 12 Tf 72 720 Td ({title}) Tj ET");
|
||||
let content = doc.add(Object::Stream(Stream::from_raw(Dict::new(), body.into_bytes())));
|
||||
let page = doc.add(dict([
|
||||
("Type", Object::name("Page")),
|
||||
("Parent", Object::Ref(pages)),
|
||||
("MediaBox", Object::Array([0, 0, 612, 792].map(Object::Int).to_vec())),
|
||||
("Contents", Object::Ref(content)),
|
||||
("Resources", Object::Dict(dict([("Font", Object::Dict(dict([("F1", Object::Ref(font))])))]))),
|
||||
]));
|
||||
doc.set(pages, dict([("Type", Object::name("Pages")), ("Kids", Object::Array(vec![Object::Ref(page)])), ("Count", Object::Int(1))]));
|
||||
let destinations = doc.add(dict([(
|
||||
"Names",
|
||||
Object::Array(vec![Object::String(PdfString::text("PaymentSchedule")), Object::Array(vec![Object::Ref(page), Object::name("Fit")])]),
|
||||
)]));
|
||||
let mut names = dict([("Dests", Object::Ref(destinations))]);
|
||||
if let Some(key) = attachment_key {
|
||||
let payload = format!("{title}: vendor insurance verified; review owner Procurement Operations; next review 2027-01-31.\n");
|
||||
let file = doc.add(Object::Stream(Stream::from_raw(
|
||||
dict([
|
||||
("Type", Object::name("EmbeddedFile")),
|
||||
("Subtype", Object::name("text/plain")),
|
||||
("Params", Object::Dict(dict([("Size", Object::Int(payload.len() as i64))]))),
|
||||
]),
|
||||
payload.into_bytes(),
|
||||
)));
|
||||
let spec = doc.add(dict([
|
||||
("Type", Object::name("Filespec")),
|
||||
("F", Object::String(PdfString::text("vendor-compliance.txt"))),
|
||||
("EF", Object::Dict(dict([("F", Object::Ref(file))]))),
|
||||
]));
|
||||
let leaf = doc.add(dict([
|
||||
("Names", Object::Array(vec![Object::String(PdfString::literal(key.clone())), Object::Ref(spec)])),
|
||||
("Limits", Object::Array(vec![Object::String(PdfString::literal(key.clone())), Object::String(PdfString::literal(key))])),
|
||||
]));
|
||||
let tree = doc.add(dict([("Kids", Object::Array(vec![Object::Ref(leaf)]))]));
|
||||
names.set(b"EmbeddedFiles".to_vec(), Object::Ref(tree));
|
||||
}
|
||||
let names = if indirect_names { Object::Ref(doc.add(names)) } else { Object::Dict(names) };
|
||||
let root = doc.add(dict([("Type", Object::name("Catalog")), ("Pages", Object::Ref(pages)), ("Names", names)]));
|
||||
doc.trailer_mut().set(b"Root".to_vec(), Object::Ref(root));
|
||||
Arc::new(write_full(&doc, &SaveOptions::default()).unwrap())
|
||||
}
|
||||
|
||||
fn attachments(doc: &Document) -> Vec<(Vec<u8>, Vec<u8>)> {
|
||||
fn visit(doc: &Document, tree: &Object, out: &mut Vec<(Vec<u8>, Vec<u8>)>) {
|
||||
let tree = doc.resolve(tree);
|
||||
let tree = tree.as_dict().unwrap();
|
||||
if let Some(names) = tree.get(b"Names") {
|
||||
for pair in doc.resolve(names).as_array().unwrap().as_chunks::<2>().0 {
|
||||
let key = pair[0].as_string().unwrap();
|
||||
let spec = doc.resolve(&pair[1]);
|
||||
let ef = doc.resolve(spec.as_dict().unwrap().get(b"EF").unwrap());
|
||||
let file = doc.resolve(ef.as_dict().unwrap().get(b"F").unwrap());
|
||||
let Object::Stream(file) = file.as_ref() else { panic!("embedded file stream expected") };
|
||||
out.push((key.bytes.to_vec(), file.decoded().unwrap()));
|
||||
}
|
||||
}
|
||||
if let Some(kids) = tree.get(b"Kids") {
|
||||
for kid in doc.resolve(kids).as_array().unwrap() {
|
||||
visit(doc, kid, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
let catalog = doc.get(doc.root().unwrap());
|
||||
let names = doc.resolve(catalog.as_dict().unwrap().get(b"Names").unwrap());
|
||||
let mut out = Vec::new();
|
||||
if let Some(tree) = names.as_dict().unwrap().get(b"EmbeddedFiles") {
|
||||
visit(doc, tree, &mut out);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
fn assert_destination_retained(doc: &Document) {
|
||||
let catalog = doc.get(doc.root().unwrap());
|
||||
let names = doc.resolve(catalog.as_dict().unwrap().get(b"Names").unwrap());
|
||||
let dests = doc.resolve(names.as_dict().unwrap().get(b"Dests").expect("target destination tree retained"));
|
||||
let values = dests.as_dict().unwrap().get(b"Names").unwrap().as_array().unwrap();
|
||||
assert_eq!(values[0].as_string().unwrap().to_text(), "PaymentSchedule");
|
||||
let page = values[1].as_array().unwrap()[0].as_ref().unwrap();
|
||||
assert_eq!(doc.get(page).as_dict().unwrap().name(b"Type"), Some(b"Page".as_slice()));
|
||||
}
|
||||
|
||||
fn insert(bytes: Arc<Vec<u8>>) -> Edit {
|
||||
Edit::InsertPagesFrom { name: "Facilities Compliance Annex.pdf".into(), bytes, pages: None, at: 1, field_conflicts: FieldConflicts::Rename }
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inserted_catalog_attachments_follow_native_undo_redo() {
|
||||
let unicode = "合规审查.txt";
|
||||
let be: Vec<u8> = [0xfe, 0xff].into_iter().chain(unicode.encode_utf16().flat_map(u16::to_be_bytes)).collect();
|
||||
let le: Vec<u8> = [0xff, 0xfe].into_iter().chain(unicode.encode_utf16().flat_map(u16::to_le_bytes)).collect();
|
||||
for key in [b"vendor-compliance.txt".to_vec(), be, le] {
|
||||
// Check raw keys to preserve the incoming encoding, including LE files
|
||||
// whose labels PdfString::to_text does not currently decode.
|
||||
let mut renamed = key.clone();
|
||||
match key.get(..2) {
|
||||
Some([0xfe, 0xff]) => renamed.extend(" (2)".encode_utf16().flat_map(u16::to_be_bytes)),
|
||||
Some([0xff, 0xfe]) => renamed.extend(" (2)".encode_utf16().flat_map(u16::to_le_bytes)),
|
||||
_ => renamed.extend_from_slice(b" (2)"),
|
||||
}
|
||||
for indirect in [false, true] {
|
||||
let target = packet("Facilities Service Agreement", Some(key.clone()), indirect);
|
||||
let source = packet("Facilities Compliance Annex", Some(key.clone()), true);
|
||||
let mut session = Session::new();
|
||||
session.set_javascript(false);
|
||||
let id = session.open("Facilities Contract.pdf", None, target, None).unwrap();
|
||||
session.apply(id, Edit::Batch { label: "Merge Annex".into(), edits: vec![insert(source.clone())] }).unwrap();
|
||||
let bytes = session.save_bytes(id).unwrap();
|
||||
let merged = Document::open(bytes).unwrap();
|
||||
let entries = attachments(&merged);
|
||||
assert_eq!(entries.len(), 2, "target and source attachments must survive");
|
||||
assert!(entries.windows(2).all(|p| p[0].0 < p[1].0), "name tree keys sorted and unique");
|
||||
let by_key: BTreeMap<_, _> = entries.into_iter().collect();
|
||||
assert!(by_key[&key].starts_with(b"Facilities Service Agreement:"));
|
||||
assert!(by_key[&renamed].starts_with(b"Facilities Compliance Annex:"));
|
||||
assert_destination_retained(&merged);
|
||||
assert_eq!(session.get(id).unwrap().info.pages.len(), 2);
|
||||
assert_eq!(session.get(id).unwrap().can_undo(), Some("Merge Annex"));
|
||||
session.undo(id).unwrap();
|
||||
let undone = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
assert_eq!(attachments(&undone).len(), 1);
|
||||
assert_destination_retained(&undone);
|
||||
assert_eq!(session.get(id).unwrap().info.pages.len(), 1);
|
||||
session.redo(id).unwrap();
|
||||
let redone = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
assert_eq!(attachments(&redone).len(), 2);
|
||||
assert_destination_retained(&redone);
|
||||
assert_eq!(session.get(id).unwrap().info.pages.len(), 2);
|
||||
assert_eq!(attachments(&Document::open(source).unwrap()).len(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inserting_into_a_document_without_attachments_retains_other_names() {
|
||||
let mut session = Session::new();
|
||||
session.set_javascript(false);
|
||||
let id = session.open("Facilities Contract.pdf", None, packet("Facilities Service Agreement", None, true), None).unwrap();
|
||||
session.apply(id, insert(packet("Facilities Compliance Annex", Some(b"vendor-compliance.txt".to_vec()), true))).unwrap();
|
||||
let result = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
assert_eq!(attachments(&result).len(), 1);
|
||||
assert_destination_retained(&result);
|
||||
session.undo(id).unwrap();
|
||||
assert!(attachments(&Document::open(session.save_bytes(id).unwrap()).unwrap()).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inserting_without_source_attachments_does_not_rewrite_target_names() {
|
||||
let mut session = Session::new();
|
||||
session.set_javascript(false);
|
||||
let id = session
|
||||
.open("Facilities Contract.pdf", None, packet("Facilities Service Agreement", Some(b"contract-evidence.txt".to_vec()), true), None)
|
||||
.unwrap();
|
||||
let before = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
let names = before.get(before.root().unwrap()).as_dict().unwrap().get(b"Names").unwrap().clone();
|
||||
assert!(matches!(names, Object::Ref(_)));
|
||||
session.apply(id, insert(packet("Facilities Payment Schedule", None, false))).unwrap();
|
||||
let after = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
assert_eq!(after.get(after.root().unwrap()).as_dict().unwrap().get(b"Names"), Some(&names));
|
||||
assert_eq!(attachments(&after), attachments(&before));
|
||||
assert_destination_retained(&after);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn selecting_no_pages_does_not_import_catalog_attachments() {
|
||||
let mut session = Session::new();
|
||||
session.set_javascript(false);
|
||||
let id = session
|
||||
.open("Facilities Contract.pdf", None, packet("Facilities Service Agreement", Some(b"contract-evidence.txt".to_vec()), true), None)
|
||||
.unwrap();
|
||||
let before = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
session
|
||||
.apply(
|
||||
id,
|
||||
Edit::InsertPagesFrom {
|
||||
name: "Facilities Compliance Annex.pdf".into(),
|
||||
bytes: packet("Facilities Compliance Annex", Some(b"vendor-compliance.txt".to_vec()), true),
|
||||
pages: Some(Vec::new()),
|
||||
at: 1,
|
||||
field_conflicts: FieldConflicts::Rename,
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(session.get(id).unwrap().info.pages.len(), 1);
|
||||
let after = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
assert_eq!(attachments(&after), attachments(&before));
|
||||
assert_destination_retained(&after);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_insert_batch_rolls_back_pages_and_attachments() {
|
||||
let mut session = Session::new();
|
||||
session.set_javascript(false);
|
||||
let id = session
|
||||
.open("Facilities Contract.pdf", None, packet("Facilities Service Agreement", Some(b"contract-evidence.txt".to_vec()), true), None)
|
||||
.unwrap();
|
||||
assert!(
|
||||
session
|
||||
.apply(
|
||||
id,
|
||||
Edit::Batch {
|
||||
label: "Merge Annex".into(),
|
||||
edits: vec![
|
||||
insert(packet("Facilities Compliance Annex", Some(b"vendor-compliance.txt".to_vec()), true)),
|
||||
Edit::RotatePages { pages: vec![99], degrees: 90 },
|
||||
]
|
||||
}
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert_eq!(session.get(id).unwrap().info.pages.len(), 1);
|
||||
assert_eq!(session.get(id).unwrap().can_undo(), None);
|
||||
let result = Document::open(session.save_bytes(id).unwrap()).unwrap();
|
||||
assert_eq!(attachments(&result).len(), 1);
|
||||
assert_destination_retained(&result);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ pub fn set_attachment_description(doc: &mut Document, key: &str, description: Op
|
||||
}
|
||||
|
||||
/// The `/EmbeddedFiles` entries (key, file specification), in tree order.
|
||||
fn entries(doc: &Document) -> Vec<(Vec<u8>, Object)> {
|
||||
pub(crate) fn entries(doc: &Document) -> Vec<(Vec<u8>, Object)> {
|
||||
let Some(tree) = doc
|
||||
.root()
|
||||
.and_then(|r| doc.get(r).as_dict().cloned())
|
||||
|
||||
@@ -105,7 +105,9 @@ fn added_objects(dst: &Document, before: &HashSet<u32>) -> Vec<ObjRef> {
|
||||
/// under one new bookmark titled `title` (the file's name) at its first inserted page, as Combine
|
||||
/// Files does for each file. That bookmark goes among the top-level bookmarks where the pages went:
|
||||
/// before the first one that points after them. Bookmarks to pages left out stay behind, unless a
|
||||
/// bookmark below them leads to an inserted page; a file without bookmarks adds none.
|
||||
/// bookmark below them leads to an inserted page; a file without bookmarks adds none. Catalog
|
||||
/// attachments are merged with the destination's attachments, with duplicate name-tree keys
|
||||
/// renamed, as in Combine Files.
|
||||
pub fn insert_file_pages(
|
||||
dst: &mut Document,
|
||||
src: &Document,
|
||||
@@ -125,6 +127,15 @@ pub fn insert_file_pages(
|
||||
let after = at.min(crate::page_count(dst)?.saturating_sub(imported.pages.len())).saturating_add(imported.pages.len());
|
||||
insert_file_bookmark(dst, &Mark { title: title.to_string(), page: *first, outline }, after)?;
|
||||
}
|
||||
if !imported.pages.is_empty() {
|
||||
let mut incoming = Vec::new();
|
||||
carry::collect_attachments(dst, src, &mut incoming)?;
|
||||
if !incoming.is_empty() {
|
||||
let mut attachments = crate::attachments::entries(dst);
|
||||
attachments.append(&mut incoming);
|
||||
set_attachments(dst, attachments)?;
|
||||
}
|
||||
}
|
||||
Ok(ImportOutcome { pages: imported.pages, renamed_fields: imported.renamed_fields })
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -128,7 +128,7 @@
|
||||
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-15 · **Change:** minor (M2: objects in one large object stream are read in linear time; estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-16; **Last updated:** 2026-10-16; **Change:** minor (M5 #2669, item 5: reply groups and page root counts per frame; estimates unchanged)
|
||||
>
|
||||
> **Last reviewed:** 2026-10-13 · **Last updated:** 2026-10-14 · **Change:** minor (M14: the Italian catalog has every entry the other catalogs had and the code looks up, 2,528 entries; estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-13 · **Last updated:** 2026-10-16 · **Change:** patch (M4: Insert from File retains catalog attachments in its undo step; estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-16 | **Last updated:** 2026-10-16 | **Change:** minor (M10 #1201 partial: lossless image Decode; estimates unchanged) | **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-13 · **Change:** minor (M2/M6: spot-colour images convert once per pixel value; widget placement and the Fields panel scale with the field count; estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-14 · **Last updated:** 2026-10-14 · **Change:** minor (M3 candidate: coordinate control clicks on slow frames and coalesced text selection; estimates unchanged) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
@@ -266,7 +266,7 @@ total matches the parity estimate.
|
||||
| M2 | Model, render, text | 200–350 | 15% | 130–230 | hayro bootstrap renderer (vendored patches); inspector predictor scratch is bounded by available input, and JPX sample rescaling handles 1–32 bits safely. Text extraction reaches word-F1 0.98 against pdftotext. Short same-line redraws split before placement rather than interleaving. A custom text match that ends on a reconstructed separator stops before the next glyph (#1315). Missing: model crate, fonts, DisplayList, renderer independent of hayro. Inspector page-label traversal and output are resource-bounded, with physical-number fallback warnings |
|
||||
| M2 | Model, render, text | 200–350 | 15% | 130–230 | hayro bootstrap renderer (vendored patches); Lab Bradford adaptation uses LMS white-point ratios, covered by independent neutral/chromatic and direct/Indexed render oracles; inspector predictor scratch is bounded by available input, and JPX sample rescaling handles 1–32 bits safely. Text extraction reaches word-F1 0.98 against pdftotext. Short same-line redraws split before placement rather than interleaving. Missing: model crate, fonts, DisplayList, renderer independent of hayro. Inspector page-label traversal and output are resource-bounded, with physical-number fallback warnings. Literal page-label prefix whitespace is preserved; nine public-inspection cases cover prefix spaces, encodings and empty-prefix controls |
|
||||
| M3 | Viewer app (native + web) | 80–150 | 90% | 10–20 | Acrobat-style shell, find, select, panels, tiles, web build, UI control channel for agents (opt-in). Missing: 60 fps test on a 500-page document, snapshot tests of every panel<br>Done since: fit visible, document title in the window; Linux middle-button scrolling; shared three-state theme preferences in the toolbar, View menu and control channel; numeric Linux portal events and idle wakeups completing #881, with native appearance inheritance retained (#446); late browser startup downloads preserve the current document and Save target (#171). |
|
||||
| M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:<br>- command registry (menus, shortcuts and palette all use it);<br>- undo/redo; incremental, atomic and encrypted saves;<br>- autosave and crash recovery;<br>- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;<br>- CLI `edit/combine/extract/split`.<br>Done since: Organize opens directly into the page overview, with checkbox selection, an editable page-range selection (#1092), and per-page rotate/delete controls; Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Extract and Split preserve shared Type 3 glyph resource graphs, retaining conservative pruning limits. Undo back to the opened or last saved file is clean; Revert opens that saved file after an undo; a later save appends to it so the saved revision stays in the file (#1310, #1311, #1312). Ctrl-drag (Option on macOS) on a grid thumbnail copies the pages into the drop gap, with a "+" badge and the copies selected (#2997). Initial-view window and interface options resolve indirect boolean preferences. Done since: #3309: Stack-safe named-destination pruning visits shared/cyclic indirect nodes once, without a name-count limit. Synthetic deep-tree and 60,000-name tests verify deletion, surviving targets, undo/redo, both save modes and reopening. Organize drags cancel after document edits and Undo/Redo (#3916 partial). Document Properties dismisses stale drafts after edits, reloads or tab changes; JSONL replay covers commit, cancellation and save/reopen. Missing: page transitions, recovery on the web. Maintainers are reviewing the vendored Document Properties runtime and the optional local scenario replay. |
|
||||
| M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:<br>- command registry (menus, shortcuts and palette all use it);<br>- undo/redo; incremental, atomic and encrypted saves;<br>- autosave and crash recovery;<br>- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;<br>- CLI `edit/combine/extract/split`.<br>Done since: Organize opens directly into the page overview, with checkbox selection, an editable page-range selection (#1092), and per-page rotate/delete controls; Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Extract and Split preserve shared Type 3 glyph resource graphs, retaining conservative pruning limits. Undo back to the opened or last saved file is clean; Revert opens that saved file after an undo; a later save appends to it so the saved revision stays in the file (#1310, #1311, #1312). Insert from File retains catalog attachments in the same undo step, preserving existing destination name trees and duplicate-key encoding. Ctrl-drag (Option on macOS) on a grid thumbnail copies the pages into the drop gap, with a "+" badge and the copies selected (#2997). Initial-view window and interface options resolve indirect boolean preferences. Done since: #3309: Stack-safe named-destination pruning visits shared/cyclic indirect nodes once, without a name-count limit. Synthetic deep-tree and 60,000-name tests verify deletion, surviving targets, undo/redo, both save modes and reopening. Organize drags cancel after document edits and Undo/Redo (#3916 partial). Document Properties dismisses stale drafts after edits, reloads or tab changes; JSONL replay covers commit, cancellation and save/reopen. Missing: page transitions, recovery on the web. Maintainers are reviewing the vendored Document Properties runtime and the optional local scenario replay. |
|
||||
| M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:<br>- command registry (menus, shortcuts and palette all use it);<br>- undo/redo; incremental, atomic and encrypted saves;<br>- autosave and crash recovery;<br>- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;<br>- CLI `edit/combine/extract/split`.<br>Done since: Organize opens directly into the page overview, with checkbox selection, an editable page-range selection (#1092), and per-page rotate/delete controls; Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Extract and Split preserve shared Type 3 glyph resource graphs, retaining conservative pruning limits. Undo back to the opened or last saved file is clean; Revert opens that saved file after an undo; a later save appends to it so the saved revision stays in the file (#1310, #1311, #1312). Rotation queries and edits resolve indirect values on pages and ancestors. Refreshed against upstream `99941daa` (2026-10-15). Repeated page indices accumulate rotations from the latest local value (#1919); saved/reopened regressions retain inherited angles and siblings. Missing: page transitions, recovery on the web |
|
||||
| M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:<br>- command registry (menus, shortcuts and palette all use it);<br>- undo/redo; incremental, atomic and encrypted saves;<br>- autosave and crash recovery;<br>- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;<br>- CLI `edit/combine/extract/split`.<br>Done since: Organize opens directly into the page overview, with checkbox selection, an editable page-range selection (#1092), and per-page rotate/delete controls; Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Extract and Split preserve shared Type 3 glyph resource graphs, retaining conservative pruning limits. Undo back to the opened or last saved file is clean; Revert opens that saved file after an undo; a later save appends to it so the saved revision stays in the file (#1310, #1311, #1312). Rotation queries and edits resolve indirect values on pages and ancestors. Missing: page transitions, recovery on the web |
|
||||
| M4 | Engine, history, save, organize | 100–180 | 95% | 8–15 | Done:<br>- command registry (menus, shortcuts and palette all use it);<br>- undo/redo; incremental, atomic and encrypted saves;<br>- autosave and crash recovery;<br>- organize, combine, extract, split and insert-from-file, with identical fonts and images stored once;<br>- CLI `edit/combine/extract/split`.<br>Done since: Organize opens directly into the page overview, with checkbox selection, an editable page-range selection (#1092), and per-page rotate/delete controls; Combine files in its own tab (sortable, resizable columns; folders; early warnings; unlocking protected files), bookmark editing, page labels (Number pages), CLI `run`, Set Page Boxes, Crop tool, Duplicate pages, Ctrl+A / Cmd+A to select all pages in Organize, Replace pages, bookmarks from tagged headings. Extract and Split preserve shared Type 3 glyph resource graphs, retaining conservative pruning limits. Missing: page transitions, recovery on the web M4: Insert-from-file preserves source bookmarks; integration tests retained with current main. |
|
||||
@@ -380,6 +380,8 @@ Estimates unchanged.
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-18 | patch | M7 #7687: PDF-page watermarks clip source crops to MediaBox before sizing and rotation; synthetic geometry and save/reopen render coverage. Estimates unchanged. |
|
||||
|
||||
| 2026-10-16 | patch | M4: Insert from File retains catalog attachments with native undo/redo; existing name trees and encoded duplicate keys survive. Estimates unchanged. |
|
||||
| 2026-11-16 | patch | M5 #3741: Ctrl+M opens Comments on Windows/Linux without toggling it closed; macOS leaves Command+M for Minimize; platform-specific shortcut surfaces and regressions retained; estimates unchanged. |
|
||||
| 2026-10-29 | minor | M10 #5029: existing Text appearances keep their implicit NoRotate orientation in vector printing even when the flag is clear. Print eligibility and source/AP objects remain unchanged; native viewing without the flag remains a separate gap. Estimates unchanged. |
|
||||
| 2026-10-27 | minor | M10 #5029: vector printing preserves existing NoRotate appearance orientation and anchors; estimates unchanged. Missing appearances and NoZoom print behavior remain unchanged. |
|
||||
|
||||
@@ -2788,8 +2788,8 @@ milestone = "M4"
|
||||
status = "shipped"
|
||||
commands = ["page.insert"]
|
||||
tools = ["page_insert_file"]
|
||||
evidence = ["crates/organize/src/tests.rs::inserting_pages_from_another_file_is_an_incremental_edit", "crates/organize/src/tests.rs::inserting_a_file_brings_its_bookmarks_under_one_named_after_it", "crates/automation/tests/it/automation.rs::inserting_a_file_brings_its_bookmarks", "crates/ui-egui/tests/it/editing.rs::inserting_a_file_goes_after_the_selection_and_undoes", "crates/ui-egui/tests/it/editing.rs::plus_between_pages_inserts_picked_files_there_in_order"]
|
||||
notes = "After the selection (toolbar, File menu) or at any gap of the page grid (a + between pages and at both ends); several files at once, in order; images and .txt files are converted first; the inserted pages end up selected. The file's bookmarks come along, collapsed under one named after the file, placed among the document's bookmarks where the pages went (as Combine does per file). The page_insert_file tool takes PDFs only. Missing: choosing which pages of the file to insert in the app; the file's tags (structure tree) are not merged."
|
||||
evidence = ["crates/organize/src/tests.rs::inserting_pages_from_another_file_is_an_incremental_edit", "crates/organize/src/tests.rs::inserting_a_file_brings_its_bookmarks_under_one_named_after_it", "crates/automation/tests/it/automation.rs::inserting_a_file_brings_its_bookmarks", "crates/ui-egui/tests/it/editing.rs::inserting_a_file_goes_after_the_selection_and_undoes", "crates/ui-egui/tests/it/editing.rs::plus_between_pages_inserts_picked_files_there_in_order", "crates/engine/tests/insert_attachments.rs::inserted_catalog_attachments_follow_native_undo_redo"]
|
||||
notes = "After the selection (toolbar, File menu) or at any gap of the page grid (a + between pages and at both ends); several files at once, in order; images and .txt files are converted first; the inserted pages end up selected. The file's bookmarks come along, collapsed under one named after the file, placed among the document's bookmarks where the pages went (as Combine does per file). Catalog attachments are merged with the document's existing attachments in the same undo step; colliding names are suffixed without changing their encoding. The page_insert_file tool takes PDFs only. Missing: choosing which pages of the file to insert in the app; the file's tags (structure tree) are not merged."
|
||||
|
||||
[[feature]]
|
||||
id = "organize.insert-from-clipboard"
|
||||
@@ -3171,9 +3171,9 @@ tier = "P1"
|
||||
milestone = "M4"
|
||||
status = "shipped"
|
||||
commands = []
|
||||
tools = []
|
||||
evidence = ["crates/organize/src/tests.rs::combine_nests_source_bookmarks_and_keeps_attachments"]
|
||||
notes = ""
|
||||
tools = ["doc_combine", "page_insert_file"]
|
||||
evidence = ["crates/organize/src/tests.rs::combine_nests_source_bookmarks_and_keeps_attachments", "crates/engine/tests/insert_attachments.rs::inserted_catalog_attachments_follow_native_undo_redo", "crates/engine/tests/insert_attachments.rs::inserting_into_a_document_without_attachments_retains_other_names"]
|
||||
notes = "Also preserved by Insert from File, including native undo/redo and existing destination name trees. This covers catalog EmbeddedFiles, not PDF 2.0 associated-file relationships (AF)."
|
||||
|
||||
[[feature]]
|
||||
id = "organize.field-name-conflicts"
|
||||
|
||||
Reference in new issue
Block a user