* M5.6: preserve nested annotation values in FDF exports Copy and renumber retained object graphs without expanding aliases or following indirect cycles recursively. Refuse excessive work and propagate export errors before the destination is written. Cover saved geometry, colour and borders, shared graphs, streams, stale references and refusal through automation tools. Co-Authored-By: Codex <noreply@openai.com> * Bound FDF annotation copying before allocation Keep selected aliases shared, budget retained keys and values before copying, and add direct-payload and alias-count regressions. Retain copied-graph limits and document source-memory scope. * M5.6: bound FDF cache-eviction discovery and field values Extend the concurrent annotation-budget correction while retaining its direct-payload and alias regressions. Record annotation positions instead of resolved bodies so cache eviction cannot pin repeated parsed copies; borrow direct values and budget retained entries before cloning. Count every emitted multi-select field value before allocating its output array. Observed pre-fix allocation-cap and field-limit failures, then fixed tests passed. Final validation: 549 scoped XFDF/engine/automation tests passed, three existing ignored; strict all-targets Clippy, WASM, fmt, layers, assets, parity and diff checks passed. AI assistance: OpenAI Codex for @MMexicann. * M5.6: record bounded FDF export regression evidence Record comment cache-eviction discovery and emitted-field-value budget regressions without changing feature scores or status. Describe copied-graph limits and existing source-parser limits precisely. Final 549 scoped tests, strict Clippy, WASM, fmt, layers, assets and parity passed. AI assistance: OpenAI Codex for @MMexicann. * M5.6: align FDF progress with budgeted discovery Document lazy annotation positions, cache-eviction coverage and copied-graph limits while retaining the original nested-value progress entry and all upstream notes. Estimates unchanged. AI assistance: OpenAI Codex for @MMexicann. * M5.6: describe FDF discovery and copied-graph limits Align exchange documentation with the tested lazy-position discovery implementation and its copied-graph limits. Source parsing/page discovery keep existing limits. AI assistance: OpenAI Codex for @MMexicann. * M5.6: align milestone notes with FDF discovery limits Retain upstream milestone history and describe the tested discovery/copy budgets without increasing estimates or claiming a total source-memory bound. AI assistance: OpenAI Codex for @MMexicann. * M5.6: keep nested page links out of FDF exports Preserve graph aliases and existing budgets; exclude direct and indirect Page/Pages type names. Add saved-PDF regression and bounded type-resolution controls. Both pre-fix failures observed; 46 scoped tests, strict Clippy, WASM and formatting passed. * M5.6: document bounded nested page exclusion Address maintainer feedback on the existing PR. Preserve upstream work and document the tested scope and remaining validation limits. * M5.6: record nested page-reference regression evidence Address maintainer feedback on the existing PR. Preserve upstream work and document the tested scope and remaining validation limits. * M5.6: retain FDF limits in milestone evidence Address maintainer feedback on the existing PR. Preserve upstream work and document the tested scope and remaining validation limits. * M5.6: cite nested page-reference exclusion tests Address maintainer feedback on the existing PR. Preserve upstream work and document the tested scope and remaining validation limits. * M5.6: respect generations while identifying page references Address maintainer feedback on the existing PR. Preserve upstream work and document tested scope and validation limits. * XFDF: document stale Type preservation regression Address maintainer feedback on the existing PR. Preserve upstream work and document tested scope and validation limits. * M5.6: record generation-aware page exclusion evidence Address maintainer feedback on the existing PR. Preserve upstream work and document tested scope and validation limits. * M5.6: propagate FDF export errors in usage example Address maintainer feedback on the existing PR. Preserve upstream work and document tested scope and validation limits. * M5.6: consolidate roadmap change and target fields Address maintainer feedback on the existing PR. Preserve upstream work and document tested scope and validation limits. --------- Co-authored-by: Codex <noreply@openai.com> Co-authored-by: skylar taylor-barrick <hi@skylar.cc>
3.1 KiB
pdfcraft-xfdf
Layer L4: comment and form data exchange (execution plan M5.6, M6.7).
let xml = export_xfdf(&doc, true, true, "form.pdf"); // comments and/or field values
let fdf = export_fdf(&doc, false, true, "form.pdf")?;
let txt = export_data(&doc, Format::Txt); // or Xml, Csv
let report = import(&mut doc, &bytes)?; // XFDF, FDF, XML, CSV or text, detected
- XFDF (ISO 19444-1): every comment type PdfCraft knows (text, free text, line, square,
circle, polygon, polyline, markup, stamp, caret, ink, attachments, sound, redact) with rect,
name, author, subject, dates, flags, colours, opacity, width, icon, quads, line ends, ink,
default appearance, callouts (
callout,fringe,intent,head), pop-ups and reply threads (inreplyto); field values nested by name, with text preserved across XML comments and processing instructions. - FDF: fields (with
/Kidshierarchies) and indirect comments. Nested annotation values are copied under FDF object numbers; shared references and cycles remain shared. Document links and appearances are excluded. Source/Pageand/Pagesdictionaries become null at every copy depth, so nested destination actions cannot carry the source page tree or content. Type names may be indirect; lookup checks each reference generation, is iterative, stops at cycles and refuses chains beyond 64 references. Discovery borrows direct arrays and dictionaries, retains array owners lazily and records annotation positions instead of resolved bodies. Retained entries are budgeted before their keys or values are cloned, including when saved-PDF cache eviction causes annotation bodies to be parsed again. Export returnsResultand refuses copied graphs above 100,000 comments/objects/values, 64 direct nesting levels or a conservative 64 MiB serialization budget instead of exporting partial data. These are copied-graph limits: source parsing and page discovery retain their existing COS/parser limits, with no total source-memory bound. Unknown indirect streams retain their encoded bytes. FDF import semantics are unchanged. - Form data: Acrobat's XML (
xfdf:originalkeeps names that aren't XML names), CSV and tab-delimited text (a row of names, a row of values).
XML and XFDF exports preserve tabs and line breaks in field names and comment metadata with character references, so XML attribute normalization cannot change their identities.
Plain AcroForm XML imports retain all direct text around comments and processing instructions, including CDATA and character references. Nested-element and XFA interpretation are unchanged.
CSV export and spreadsheet merging quote tabs, and import distinguishes quoted tabs from TSV delimiters without changing field identities. Automatic detection of externally authored, ambiguous tables remains heuristic.
Import replaces comments with the same /NM (and drops the replaced comment's pop-up), draws
appearances PdfCraft can draw, and sets values through the form's own checks (formats,
validation, recalculation); read-only fields take imported values, as in Acrobat. XML is read
with roxmltree.