M10: adopt file-backed loading and record review fixes in the progress log

This commit is contained in:
Zhihui Song
2026-11-07 15:07:16 +08:00
parent 596f8169e3
commit 014b67915b
4 changed files with 13 additions and 12 deletions
Generated
+3 -3
View File
@@ -1243,7 +1243,7 @@ dependencies = [
[[package]]
name = "craft-print"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=e398084b63413aa5d872da43496f0c0822cb749a#e398084b63413aa5d872da43496f0c0822cb749a"
source = "git+https://github.com/storytold/craft-libs?rev=93d7c7b57afc6d2d60a0b12485c4c9ca96884596#93d7c7b57afc6d2d60a0b12485c4c9ca96884596"
dependencies = [
"craft-winprint-gdi",
"log",
@@ -1324,7 +1324,7 @@ dependencies = [
[[package]]
name = "craft-winprint-gdi"
version = "0.1.0"
source = "git+https://github.com/storytold/winprint.rs?rev=17f5f1e3c5038be6bd122df36fc5b5aa2672502c#17f5f1e3c5038be6bd122df36fc5b5aa2672502c"
source = "git+https://github.com/storytold/winprint.rs?rev=b334ebbbfe2ddfdc8b2deb2a7b372f0cf0a0d3e7#b334ebbbfe2ddfdc8b2deb2a7b372f0cf0a0d3e7"
dependencies = [
"windows-sys 0.61.2",
]
@@ -8209,7 +8209,7 @@ dependencies = [
[[package]]
name = "winprint"
version = "0.2.1"
source = "git+https://github.com/storytold/winprint.rs?rev=17f5f1e3c5038be6bd122df36fc5b5aa2672502c#17f5f1e3c5038be6bd122df36fc5b5aa2672502c"
source = "git+https://github.com/storytold/winprint.rs?rev=b334ebbbfe2ddfdc8b2deb2a7b372f0cf0a0d3e7#b334ebbbfe2ddfdc8b2deb2a7b372f0cf0a0d3e7"
dependencies = [
"flate2",
"fmt-derive",
+1 -1
View File
@@ -24,7 +24,7 @@ craft-keymap = { git = "https://github.com/storytold/craft-libs", version = "0.1
# the commit in `craft-i18n.rev`). Already in the tree through craft-ui.
craft-i18n = { git = "https://github.com/storytold/craft-libs", version = "0.1.0", rev = "787a7a0f972fd1d7a7618fdbeca3a5267a0407ff" }
# Shared system spooler; document composition remains in pdfcraft-print.
craft-print = { git = "https://github.com/storytold/craft-libs", version = "0.1.0", rev = "e398084b63413aa5d872da43496f0c0822cb749a" }
craft-print = { git = "https://github.com/storytold/craft-libs", version = "0.1.0", rev = "93d7c7b57afc6d2d60a0b12485c4c9ca96884596" }
# Whether a path stored in a document may be opened (GoToR link targets).
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "787a7a0f972fd1d7a7618fdbeca3a5267a0407ff" }
# craft-update: app-specific pretend versions apply to startup and manual checks.
+2 -1
View File
@@ -1,6 +1,6 @@
# PdfCraft roadmap
> **Last reviewed:** 2026-11-07 | **Last updated:** 2026-11-07 | **Change:** patch (M10: adopt stream-based Windows PDF job loading through craft-print, preserve the #5006 Direct2D fix, remove personal-fork/global overrides; physical output still unqualified; estimates unchanged)
> **Last reviewed:** 2026-11-07 | **Last updated:** 2026-11-07 | **Change:** patch (M10: file-backed Windows PDF loading without whole-job buffering or per-chunk async waits; approved dependency chain retains #5006; physical output still unqualified; estimates unchanged)
> **Last reviewed:** 2026-11-03 | **Last updated:** 2026-11-03 | **Change:** patch (M5 #5850 review: indirect typewriter intent and composer edits preserve outer whitespace; movement regression commits by outside click; estimates unchanged)
@@ -790,6 +790,7 @@ Newest first: the date, what moved, and the new overall estimate.
| Date | Change | Summary |
|---|---|---|
| 2026-11-07 | patch | M10 #6514: load Windows PDF print jobs on demand through a read-only file stream, avoiding StorageFile access denial, whole-file buffering and per-chunk async waits; approved dependencies retain the #5006 crash fix. Regression tests pass; physical output remains unqualified; estimates unchanged. |
| 2026-11-03 | patch | M5 #5850 review: indirect typewriter intent and composer edits preserve outer whitespace; movement regression commits by outside click; estimates unchanged. |
| 2026-11-03 | patch | M5 #5850: Enter adds Fill & Sign line breaks; outside clicks commit, Escape cancels, and saved multiline appearances retain their text and height; estimates unchanged. |
| 2026-11-01 | patch | M7 #5657: header/footer, watermark and background operations commit all selected pages together; later-page errors preserve marks, content, shared/inherited resources and pending edits; estimates unchanged. |
+7 -7
View File
@@ -4,16 +4,16 @@ A report on PdfCraft 0.19.0 described the preview closing without output while E
The native submission test failed before queueing: `StorageFile::GetFileFromPathAsync` returned `0x80070005` for the temporary PDF. Ordinary desktop file access could read it. This isolates one reproducible failure; it does not establish the cause of every report of an empty print queue.
The winprint loader reads the job using desktop file access, transfers it in 64 KiB chunks to an `InMemoryRandomAccessStream`, and calls `PdfDocument::LoadFromStreamAsync`. It does not fall back to another printer or retry an already submitted job. Tickets, layout, permissions and completion handling remain in place. The stream still holds the PDF in memory; large-job memory use needs qualification.
The winprint loader uses `CreateRandomAccessStreamOnFile` with read-only access, then calls `PdfDocument::LoadFromStreamAsync`. The stream is backed by the job file and reads on demand. There is no whole-job `InMemoryRandomAccessStream` copy, `DataWriter`, transfer loop or per-chunk `StoreAsync().join()`. The path is made absolute and embedded NUL characters are rejected before calling the native API. The temporary file remains alive throughout rendering and submission through craft-print's existing lifetime management. PDF decoding and rendering can still allocate memory; the change removes the loader's full-file copy, not all printing memory use.
Upstream fix: https://github.com/storytold/winprint.rs/pull/15. PdfCraft now updates only its `craft-print` dependency, with no global `[patch]` override. Both printing libraries are pinned to winprint `17f5f1e3`, a child of `64e7afd4` containing the multi-threaded Direct2D factory fix for #5006. All Git source URLs remain under `storytold`; the dependency follow-up is https://github.com/storytold/craft-libs/pull/636 (stacked on #605). Upstream reviews are still required before release.
Upstream loader: https://github.com/storytold/winprint.rs/pull/15 (`b334ebbb`). Dependency follow-up: https://github.com/storytold/craft-libs/pull/636 (`93d7c7b5`, stacked on #605). PdfCraft updates only its normal `craft-print` dependency. There is no global patch or personal-fork source. The loader revision descends from `64e7afd4`, preserving the multi-threaded Direct2D factory fix for #5006. Upstream reviews are still required before release.
## Evidence
- Existing Windows loader: synthetic A4 job failed at PDF loading with `0x80070005`.
- Stream loader: same HUAWEI job returned `spooled 1 sheet(s)`.
- No-printer regression: existing test PDF in a hidden temporary file fails under the old loader and passes under the new one.
- 14 Print Schema reader/writer tests passed. Wider native ticket tests require installing a null printer; 13 failed because Add-Printer was denied (20 passed).
- Physical paper output and a packaged 0.19.0 application build have not been independently verified. A successful queue submission is not proof of physical printing.
- Original Windows loader: synthetic A4 submission failed at PDF loading with `0x80070005`. The earlier memory-stream prototype submitted the same HUAWEI job; physical output was not independently confirmed.
- Final file-backed loader: five focused tests pass, covering a hidden PDF, read-only stream behavior, reading the final byte of a 256 MiB file, a missing file, and a path containing NUL.
- The hidden-file test was observed failing with the original StorageFile loader. The read-only test was observed failing with the earlier in-memory implementation and passing with the final loader.
- Isolated craft-print suite with the final loader and multi-threaded Direct2D source: 63 passed, 3 hardware tests ignored. These diagnostic tests are not a full build of the final dependency graph; the disabled PDFium downloader build dependencies were omitted locally.
- Full final-graph build/quality gates remain subject to CI. A packaged 0.19.0 application and physical paper output with the final loader have not been independently verified. Submission success is not proof of physical printing.
When reporting a different failure, include the PdfCraft version, printer/driver name, displayed error and whether a job appears in the Windows queue. Saving the print-ready PDF and printing it in another viewer remains a workaround until the fix ships.