mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 04:22:20 +00:00
An update whose cross-reference section has no /Prev (ISO 32000-2 §7.5.6, §7.5.8.2) cuts the earlier revisions, and the page tree with them, off the chain. The signed PDFBOX-2720 and PDFBOX-2942 files have this shape: the document model found no page tree and the renderer showed 2 blank pages found by scanning for page dictionaries. When the chain reaches only the newest section, the file holds another startxref and the catalog's /Pages can't be read, both readers now rebuild the table from the file's objects, as for a damaged file: - cos: the existing reconstruction (newest in-file definition wins), a repair-log line saying why, and `Document::rebuilt_unlinked_update`. - hayro-syntax (44): `root_xref` repairs the table before the page tree is read; `Pdf::rebuilt_unlinked_update` says so. - render: an open warning, and the lazy structure reader accepts such a rebuilt file, so links, fields and bookmarks are read too. A save rewrites the file in full (main's rule for reconstructed files). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA
35 lines
1.2 KiB
TOML
35 lines
1.2 KiB
TOML
[package]
|
|
name = "pdfcraft-render"
|
|
description = "Page rendering (bootstrap: hayro) and document inspection for PdfCraft"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
pdfcraft-cos = { workspace = true }
|
|
pdfcraft-fonts = { workspace = true }
|
|
hayro = { workspace = true }
|
|
hayro-syntax = { workspace = true }
|
|
# Picks the face of an installed font collection (the version pdfcraft-fonts already uses).
|
|
skrifa = "0.44"
|
|
lopdf = { workspace = true }
|
|
kurbo = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
log = { workspace = true }
|
|
# The reading-colours setting is persisted with the app state and echoed by the automation tool.
|
|
serde = { workspace = true }
|
|
# Reads rendered pixel words as bytes; already in the tree through hayro.
|
|
bytemuck = { version = "1" }
|
|
|
|
# lopdf (bootstrap) draws random bytes for encryption; on the web they come from the browser.
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
getrandom = { version = "0.4", features = ["wasm_js"] }
|
|
|
|
[dev-dependencies]
|
|
pdfcraft-testkit = { workspace = true }
|
|
# Builds the decompression-bomb streams in the raster tests.
|
|
flate2 = { workspace = true }
|