Commit Graph
431 Commits
Author SHA1 Message Date
Dylan M. Taylor 0b714d0ee6 Cargo.lock: resolve the craft framework at storytold/craft-libs 0a6e42b80 2026-11-23 13:32:59 -05:00
Dylan M. Taylor d0e9ba10c5 prod merge: re-pin every craft-libs entry to the synced framework (f9d38c866, pushed pdfcraft-port head; incl. craft-pkcs7, craft-html, craft-xfa, craft-xfdf, craft-web-api/web-host, preflight's craft-cms), patch craft-font-catalog, craft-xfa and craft-xfdf to it as well (one craft-font-catalog in the lock), one lock resolve, regenerate ATTRIBUTION.md 2026-11-23 08:17:33 -05:00
Dylan M. Taylor 47a2aa6652 prod merge: workspace compiles against the synced framework (system clipboard feature, dock shown set as a Tracked set, preview serials, combo box edit response, examples on the ctx signatures; fill_screen pending L-314) 2026-11-23 01:26:55 -05:00
Dylan M. Taylor b86eff8259 merge deps: union workspace deps at the port pin (wordmodel, mcp-server, jsonrpc; craft-pdf fonts; 0.22.0), hayro/framework patch paths, shared AGENTS.md with port facts, comment wording, port Cargo.lock restored. The lead re-pins craft-libs after the framework sync. 2026-11-22 22:50:16 -05:00
Dylan M. Taylor 333b287a8b Production merge skeleton: upstream/main 9b3e6d6f3 into area/app-1 6cfe35235, conflict markers left in (42 files; 4 modify/delete keep the port's deletion) 2026-11-22 22:39:00 -05:00
charlieruk 9b3e6d6f38 deps: url 2.5.9 for RUSTSEC-2026-0592 (#8092) (#8093)
url 2.5.8 overflows the stack in Url::origin() on nested blob: URLs, which aborts the process past catch_unwind. 2.5.9 fixes it; form_urlencoded 1.2.3 comes with it.
2026-11-22 21:03:44 -06:00
a18498e835 Merge release v0.22.0 back to main (#8108)
* Release 0.20.0

* Release: PdfCraft v0.22.0

---------

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
2026-11-22 18:47:33 -05:00
Dylan M. Taylor 13770dc8f4 render: enforce max_coverage via craft-libs #2546 (storytold/craft-libs#778) (#7961) 2026-11-20 09:08:58 -05:00
FredApps c05499f707 Merge pull request #2923 from regendorf-ux/pr/tab-rename
Rename the open file from its tab (Rename… and double-click), with names that work on every system (#2102, #2867)
2026-11-20 21:03:47 +07:00
Dylan M. Taylor 2c0280eb11 fonts: cut over encodings, Std14, and font wire builders to craft-pdf (#778) (#7940) 2026-11-20 07:17:06 -05:00
skylar taylor-barrickandDylan M. Taylor 20830d092c Route PDF parsing and rendering through shared craft-pdf (#2068)
* refactor(render): route PDF reading and rendering through shared craft-pdf (storytold/craft-libs#778)

* fix(render): convert u32 raster dimensions to usize for Pixels::zeroed

* fix(render): remove unused hayro_syntax imports in inspect

* fix(render): let shared raster dimensions reject rounded over-budget sizes before allocation

* chore(pdf): repin craft-libs to #2497 and align tests with shared contract

* fix(render): align remaining 8 tests and OutputLimit error with craft-libs contract

* docs(attribution): update ATTRIBUTION.md for shared hayro* dependencies

* docs(attribution): include adobe_data suffix for hayro-cmap in ATTRIBUTION.md

* docs(attribution): sync ATTRIBUTION.md with cargo xtask assets --write

* docs(licenses): update NOTICE hash and hayro-interpret asset licences in LICENSES.toml

---------

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-11-20 02:53:23 -05:00
Dylan M. Taylor 0a53d7cc22 create: use shared JPEG and JP2 embedding probes from craft-image-codecs (#778) (#7939)
* create: use shared JPEG and JP2 embedding probes from craft-image-codecs (#778)

* deps: pin craft-image-codecs to craft-libs main a7c6c9d6
2026-11-20 00:34:51 -05:00
Dylan M. Taylor e1d2f32e58 export, xfdf: cut over portable HTML writer and XFDF/FDF grammar to craft-libs (#778) (#7914)
* export, xfdf: cut over portable HTML writer and XFDF/FDF grammar to craft-libs (#778)

* fix(xfdf): align craft-xml rev with craft-xfdf and deref standalone El

* fix(xfdf): remove redundant deref on standalone(el, ns)

* xfdf, export: update craft-libs pin and add XFDF annotation round-trip test

* chore: align craft-xml rev with craft-xfdf

* chore: repin craft-xml to craft-libs main

* chore: repin craft-xml, craft-xfdf, craft-html to craft-libs main

* test(xfdf): pass &str to import_comments in round-trip test

* test(xfdf): bind dst.get(dst_ref) before as_dict

* test(fonts): import pdfcraft_cos::Stream in embedding tests

* test(xfdf): update newly added square annotation instead of widget[0]

* test(xfdf): read newly imported annotation at Annots.last() in roundtrip test
2026-11-19 22:42:25 -05:00
Dylan M. Taylor d7f4c6a668 mcp: delegate stdio framing and JSON-RPC envelopes to craft-mcp-server and craft-jsonrpc (#7910) 2026-11-19 18:38:34 -05:00
Dylan M. Taylor 14a88abca6 red9 g5: app red round 9 fixes 2026-11-19 17:26:56 -05:00
Dylan M. Taylor 13f1bf1e2d Navigation: a wheel notch eases unless animation effects are reduced, as production (F-48) 2026-11-19 13:23:52 -05:00
Dylan M. Taylor 44aaf2d003 Merge main preserving RTF safety and PPTX parity fixes 2026-11-18 21:06:36 -05:00
Dylan M. Taylor aea595f33c lead: the mode bar's tab strip takes its natural length inside the bar (the framework's collection-scroll rule; 4,568 test panics) 2026-11-18 19:52:27 -05:00
Dylan M. Taylor c07c6954e7 test compile fix 2 (all) (swarm/tfix2); committed by the lead 2026-11-18 19:22:11 -05:00
Dylan M. Taylor 79477f3909 Point hayro-postscript to storytold/craft-libs (storytold/craft-libs#790) (#7828) 2026-11-18 19:08:53 -05:00
Dylan M. Taylor 8f4f4ea9c5 Cut over pptx export to craft-pptx (#7823)
* cut over pptx export to craft-pptx (storytold/craft-libs#792)

* style(export): run cargo fmt on pptx.rs
2026-11-18 18:57:36 -05:00
Dylan M. Taylor 5727e93321 compile fix 8 (all): paragraph painted through ContentPainter components (L-222), comments overlay on PageSession, CanvasAction CopyText/ColourRequest, crates/fonts emits EmbeddedFace (L-221) (swarm/cfix8); committed by the lead 2026-11-18 18:42:29 -05:00
kiwi4boy f77ad824ee Merge main (#7814, which landed steps 1 and 2) and keep the RTF picture fixes
#7814 brought this branch's first two commits to main inside step 2, but not the three
fixes made here since: the RTF picture budget that counts every placement, rotations baked
into the pictures, pictures fitted to the text height, and the pages that lost a picture
reported through truncated_pages. They now sit in step 2's Builder: RTF's flow_doc gives
it a pictures::Budget, and Word's word_doc doesn't, so Word keeps its own limits
(room_for) and turns positioned pictures through their float. The text-height fit is in
the shared picture(), so Word's flowing pictures fit too.

The truncated_pages doc now says what RTF reports: pictures lost to its own limits or a
rotation it couldn't bake. A picture no format can encode is left out of all of them.
2026-11-18 17:28:58 -05:00
Dylan M. Taylorandkiwi4boy d03b99ea54 Export: Word through craft-docx, from the shared word model (rebased #7592) (#7814)
* export: write RTF through craft-rtf's full writer, from the word model

The pages are mapped onto a craft_wordmodel::Document (as_word.rs, the
mapping the DOCX export will share), and craft_rtf::doc::export writes
it. Over the small writer this keeps, in RTF:
- pictures, inline (the engine no longer leaves them out for RTF);
- each page's size, as a section per page (blank pages kept);
- Heading 1 and 2 styles;
- the title;
- hard line breaks inside a paragraph or cell (storytold/pdfcraft#4723).
It also fixes two bugs: \cellx was the absolute page x, so every column
edge sat one left margin too far right, and tables that touched became
one (NIST CSF 2.0 came out with 28 tables instead of 68).

craft-rtf, craft-wordmodel, craft-docx and craft-mime are pinned together
at one craft-libs commit: doc::export takes its own revision's Document.

* export: pin craft-libs main with push_text, the header-row fix and the RTF generator name

craft-rtf, craft-wordmodel, craft-docx and craft-mime move to craft-libs
b8eaa8e2, which has storytold/craft-libs#1946, #1947 and #1950. The
mapping appends through Paragraph::push_text/push_object, tables keep
the default look, and the RTF names PdfCraft as its generator.

* export: write Word through craft-docx, from the shared word model

as_docx.rs no longer writes WordprocessingML itself: as_word::word_doc
maps the pages onto a craft_wordmodel::Document and craft_docx::write
writes it. The decisions stay the same: a page with rotated text or
overlapping text keeps its layout as positioned text boxes and pictures
(watermark-sized text behind, pictures over it, other text on top), the
other pages flow, each page is a section of its own size, a shared page
colour is the document's, the PDF's language goes in the slot Word keeps
for its script, and the media limits are unchanged.

Over the hand-written package this gains:
- a VML fallback for every text box, so Word 2007 opens positioned pages;
- rotated text as a turned text box Word draws as a line;
- the body font named (Arial), with a font table saying it is a sans;
- PdfCraft as the application in docProps/app.xml;
- a picture drawn many times stored once.

The tests that matched XML read the package back through craft-docx.

* parity: the Word export through craft-docx, checked in Word 16, Word 2007 and LibreOffice

* chore: update Cargo.lock after rebasing #7592

---------

Co-authored-by: kiwi4boy <kiwi4boy@gmail.com>
2026-11-18 17:11:01 -05:00
Dylan M. Taylor 18074b1bc4 owed by pdf-hub-w1/pdf-shell-w6: facade features text, text-font-picker, font-manager, platform-clipboard, update, theme-store, imaging; ui-testing for tests; craft on both app binaries (L-207, q199) 2026-11-18 15:17:04 -05:00
Dylan M. Taylor 1cd10fb9b2 Merge current main while preserving RTF and HTML media regressions 2026-11-18 14:06:43 -05:00
Dylan M. Taylor 0b50bddc84 Bound RTF picture expansion and bake image rotations before embedding 2026-11-18 14:05:40 -05:00
FredApps bad6ac7fa2 Merge pull request #7779 from FredApps/chore/778-xfa-merged-pin
Use merged XFA namespace and BOM safety fixes
2026-11-19 00:57:14 +07:00
Dylan M. Taylor b11d37c0ed Merge pull request #7795 from storytold/fix/shared-ocsp-wrapper-pin-20261118
fix(sign): consume standard OCSP certificate wrapper parsing
2026-11-18 12:36:28 -05:00
Dylan M. TaylorandClaude Opus 5.5 53f0f6fd76 owed by pdf-hub-w1: the craft facade dependency, with the features the app sets use (contract head: every crate through the facade)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:31:32 -05:00
FredApps 6d95958ccc Use merged XFA namespace and BOM safety fixes 2026-11-18 16:08:32 +01:00
Dylan M. TaylorandClaude Opus 5.5 5fc28a9ec3 port/app-base: build against the frozen framework (pdf-port/fw-frozen-1 at trees/racheck-fw); local paths, never push
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:58:51 -05:00
Dylan M. Taylor 34d6706088 Pin shared PKCS7 adapters to merged parts API 2026-11-18 09:58:51 -05:00
Dylan M. Taylor 70c7cebde8 Merge remote-tracking branch 'base-src/main' into pr-7646
# Conflicts:
#	Cargo.lock
2026-11-18 09:50:17 -05:00
Dylan M. Taylor 78706fe8c0 Merge pull request #7654 from storytold/refactor/shared-crl
Sign: parse crl through shared PKCS7 components
2026-11-18 09:47:10 -05:00
Dylan M. Taylor babccf53e7 Merge remote-tracking branch 'origin/main' into pr-7654 2026-11-18 09:11:58 -05:00
Dylan M. Taylor b26c0c529f Merge remote-tracking branch 'origin/main' into pr-7646 2026-11-18 09:11:54 -05:00
Dylan M. Taylor 8d0ed386c0 Merge remote-tracking branch 'origin/main' into pr-7642 2026-11-18 09:11:50 -05:00
Dylan M. Taylor ef2d06e303 build: preserve Cargo canonical XML package order 2026-11-18 05:13:23 -05:00
amoisttowe1 d4da4b94bb M5.1: structural round-trip, property and never-crash tests for crates/annot (tests only)
## What this adds

Structural round-trip, property and never-crash evidence for `crates/annot`, which had no `tests/` directory — every prior test checked an in-memory object and never crossed the writer. 50 new tests take the crate from 42 to **92 passing / 0 failed**, with nothing ignored and no existing test weakened:

- `tests/round_trip.rs` (25) — annotations survive save and reopen across all three writer paths: geometry, contents text, flag bits, opacity, identifying names, pop-up back-references, link targets/URIs/dash structure, per-page order and ownership.
- `tests/properties.rs` (10) — proptest invariants over generated geometry, opacity and flags.
- `tests/malformed.rs` (15) — damaged input must never panic; each case documents the *measured* behaviour as defined degradation, not endorsed output.
- `tests/support/{bytes.rs,fixture.rs}` — a raw-byte reader and PDF skeletons, so claims can be made about the saved file rather than only about parsed objects.

`proptest = { workspace = true }` as a dev-dependency (same declaration as `cos`; style differs from the dotted form in crypt/filters). proptest 1.11.0 is already locked in the workspace, so `Cargo.lock` gains one edge and no new package.

**No product code is changed.** This pins current behaviour, including three questionable behaviours it surfaced (below), and leaves every fix to a follow-up.

## Appearance is deliberately out of scope

Nothing here asserts what an appearance stream draws, so this stays clear of #2345, #2137, #2066, #1775 and #1513 (all open, all rewriting appearance generation). Structural fidelity — where a mark sits, what it says, which rules apply — is behaviour none of them intends to alter.

## Evidence quality: mutation-tested, with credit split honestly

Ten single-site guard/arithmetic/key-rename mutants were run against `crates/annot/src/lib.rs` by two independent reviewers plus the author. All ten were caught, and they split **five and five**:

- Killed by pre-existing inline tests in `crates/annot/src/tests.rs` as well: `lib.rs:857` inverted, `:1030` inverted (six inline tests), `:1930` inverted, `:2161` tie-break swapped, `:1241` `/Parent` renamed.
- Killed **only** by tests added here: `:1030` clamp deleted, `:857` clamp deleted, opacity clamp removed at `:1024`, colour clamp in `rgb()` removed at `:824`, and a clamp introduced on the read path at `:2238`.

`lib.rs:857` and `:1030` appear on both sides deliberately — inverting either trips inline tests, deleting them trips nothing outside this branch. Confusing those two mutation families is easy enough to produce a false refutation, so the distinction is recorded in `round_trip.rs` rather than left to whoever re-runs them. A build failure was never counted as a kill in any pass. The mutants were run at `crates/annot/src/lib.rs` as of base `99941daa`. Main has since split that file into modules (`5ce4d244`); the anchor statements are byte-identical at their new homes (the `/Parent` site apart, locals renamed), but main also grew the inline suite from 42 to 74 tests — so the five-and-five split describes the base tree, and the battery was not re-run at the merge head `3122ebad`.

## Three defects found while writing this — reported, not fixed

1. **Large finite numbers are written unvalidated and become unreadable downstream.** The only style guard on the create path (`lib.rs:1018`) is `!finite(&style.color) || !style.opacity.is_finite() || !style.width.is_finite()`; the `abs() < 1e7` cap inside `finite()` (`:827-829`) applies to **colour alone**, so `width` carries no magnitude limit at all. Measured: `width = 1e9` and `1e299` are accepted and written verbatim to `/BS /W`. qpdf (`pikepdf.Job(["--check", …])`, pikepdf 9.11 / libqpdf 12.2) exits **3** — its *warning* status, printed with "operation succeeded with warnings" (0 = clean and silent here) — reporting `overflow/underflow converting <301 digits> to 64-bit integer`, and `/Annots[0]` resolves to `null` (still null after a qpdf re-save) while `pikepdf.open()` reports success. Our own `repair_log()` stays empty, which conflicts with CLAUDE.md's "never silently drop or repair data".
2. **Fill colour is accepted on create and refused on edit.** Create never screens `fill` (it is clamped component-wise by `rgb()` at `:823-825`), while `set_fill` refuses the identical value with `Invalid("invalid fill colour")` at `:2010`. Pinned by `malformed::the_same_huge_fill_is_accepted_on_create_and_refused_on_edit`.
3. **One unparseable token in a page's `/Annots` loses the whole page, silently.** For `[4 0 R notanumber]`, `page_refs()` returns `Ok([])` with `/Pages` still showing the page — so the page object itself fails to parse, every annotation on it disappears, and `repair_log()` records nothing. qpdf keeps the page and warns: `(object 3 0, offset 191): unknown token while reading object; treating as string`.

Anchors in this section read against `crates/annot/src/lib.rs` at base `99941daa`; main has since split that file (`5ce4d244`). The same code at merge head `3122ebad`: `:1018` → `create.rs:416`, `:827-829` → `create.rs:17-19`, `:823-825` → `create.rs:13-15`, `:2010` → `modify.rs:626-627`. All three described behaviours re-verified unchanged at this head.

These need a policy decision rather than a patch, so they are described here and will be filed as separate issues; nothing in this PR fixes them.

## CI status and base note

This branch was opened at `afa8e18` (then current `main`) and rebased onto `99941da`. Two jobs were red on the original base — `test (ubuntu-latest)`, `test (windows-latest)` and the FreeBSD job, all failing in `crates/automation/tests/automation.rs` at `:354` (`signing_with_translated_labels_through_tools`, which passed a 7-character password against an 8-character minimum) and at `:359` (`a_save_that_does_not_reopen_leaves_the_file_as_it_was`), `173 passed; 2 failed`. Those were upstream failures reproduced on that commit's own CI run (**38703572296**, plus the FreeBSD run **38703573428**) in a crate this change never touches; they have since been fixed on `main` by #2420 (the signing password now meets the minimum) and #2484 (save/search regression expectations updated), which is why `main`'s latest CI run is green and why this branch was rebased. The rebase is a no-op for our code: `crates/annot/src/lib.rs` at both commits is byte-identical (`fb491e19…`), so every line number cited below still resolves as written.

Since then `main` was merged in (`dc943eeb`, merge commit `3122ebad`) to clear the FreeBSD job per the CI triage on this PR: the `files_and_quit_from_the_operating_system` race was fixed on main by `12fcc641` (#2812). The merge probe was clean (zero conflicts; `Cargo.lock` the only overlapping path). Main split `crates/annot/src/lib.rs` into modules and reshaped `set_style` to take a `StyleChange`; the merge commit carries three tests-only adaptations (two `SaveOptions` literals gain `drop_unlinked: false`, the writer's default; one `set_style` call re-shaped; citations re-derived to the new file layout). No crate source diverges from main's: `git diff --stat upstream/main HEAD -- crates/annot/src/` is empty. Inline-suite counts at this head: 74 (main grew it from 42); the 42 → 92 figures above describe base `99941daa`. proptest on main's lock is now 1.12.0; one edge added, no new package.

## Where the proof stops

- The first CI run on this branch was at our original base and showed the inherited failures described above; results cited here are local macOS runs (we have no Poppler locally, so qpdf cross-checks ran through pikepdf in a workspace virtualenv).
- The probe PDFs used for qpdf measurements are **not** committed, because AGENTS.md §1 requires an `ATTRIBUTION.toml` entry per sample document — so CI cannot re-measure them. Each measurement carries a regenerate recipe and sha256 in the test comments (`malformed.rs`).
- All oracle figures are tied to one machine's build: pikepdf 9.11 over libqpdf 12.2 (`__libqpdf_version__`; the Job API rejects `--version`, so no raw qpdf version string). Poppler comparisons would need CI, as `pdftoppm` is unavailable locally.
- Mutation evidence covers single-site guard/arithmetic/key-rename mutants only — no multi-site, data-flow or off-by-one classes were attempted.
- We did not measure what any viewer displays to a user after these failures; the listed-but-null entry was observed, not rendered behaviour.

## Question for maintainers

CLAUDE.md asks new tests to be registered in `ROADMAP.md` and `parity/acrobat-features.toml`, but several open PRs above are editing both files right now, so we left them untouched to avoid collisions. Tell us where you would like these registered and we will add the lines here, or open a follow-up.

Credit: `contributors/people.toml` deliberately carries no new entry in this PR — ours is already queued on #2073.
2026-11-18 16:29:46 +07:00
Dylan M. Taylor 1a317aa7de Refresh XFDF reader adapter on merged bounded import and shared parser 2026-11-18 02:03:18 -05:00
Dylan M. Taylor 0b6306165e Parse CRL evidence through shared PKCS7 components 2026-11-17 11:56:36 -05:00
Dylan M. Taylor 42b3015319 Read XFDF field values through shared bounded parser 2026-11-17 10:42:51 -05:00
Dylan M. Taylor 79fc51b740 Use shared XFA XML DOM while retaining app form policy 2026-11-17 09:59:30 -05:00
Dylan M. Taylor 271e479c53 Merge pull request #7591 from storytold/dot/pdf-shared-markdown-20261117
Export: use shared extracted-text Markdown writer with exact output parity
2026-11-17 02:16:26 -05:00
Dylan M. Taylor 2959b7050f Fix canonical ordering of pinned XML lock entries 2026-11-17 00:06:10 -05:00
Dylan M. Taylor 4d64115874 export: pin extracted-text writer to merged shared prerequisite 2026-11-16 23:10:41 -05:00
Dylan M. Taylor 35a1d33857 sign: use shared CMS SignedData signing writer (#7584) 2026-11-16 21:59:03 -05:00
kiwi4boy 5555b1a249 export: pin craft-libs main with push_text, the header-row fix and the RTF generator name
craft-rtf, craft-wordmodel, craft-docx and craft-mime move to craft-libs
b8eaa8e2, which has storytold/craft-libs#1946, #1947 and #1950. The
mapping appends through Paragraph::push_text/push_object, tables keep
the default look, and the RTF names PdfCraft as its generator.
2026-11-16 21:36:55 -05:00
Dylan M. Taylor 46234dd471 export: map PDF layout through shared extracted-text Markdown writer 2026-11-16 21:15:46 -05:00