mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-28 20:18:06 -06:00
Follow-up to threading by /IRT reference, from review: - An /IRT that reaches no listed comment (the annotation itself, a loop, a pop-up, an object no page lists) left the annotation a reply shown nowhere, though still counted. `link_replies` now settles the links in both readers (inspect on open, the engine's list after an edit): a reply keeps its parent only when the chain reaches a comment within 64 steps, and anything else stays a comment of its own. - A reply to a reply was never shown in the Comments panel (only comment_list followed the chain, #806), but the new header line counted it. The panel now files every text reply under the comment its thread starts from (`thread_tops`); a status or checkmark stays with the annotation it was set on. - A Replace Text caret (/RT /Group) is grouped with its strikeout, not a reply to it, so the header no longer counts it (new `grouped` field on both readers). - The engine summary and comment_list gather replies once instead of rescanning every annotation per reply (quadratic on large reviews). - Inspect takes the first listing in page order instead of a min over an unordered map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.8 KiB
Rust
46 lines
1.8 KiB
Rust
//! pdfcraft-render — page rasterization and document inspection.
|
||
//!
|
||
//! **Bootstrap status (see ADR-0004):** rasterization goes straight through the `hayro` crate
|
||
//! (hayro-interpret + vello_cpu). Inspection uses the lazy `cos` reader with a read-only lopdf
|
||
//! object adapter and retains `lopdf` loading for compatibility repairs. The renderer and that
|
||
//! adapter are replaced by `model` and the DisplayList design in M1–M2. The public API is what the engine and UI rely on, so
|
||
//! the swap stays internal to this crate.
|
||
|
||
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
||
|
||
mod inspect;
|
||
mod pixels;
|
||
mod raster;
|
||
mod reading;
|
||
mod structure;
|
||
pub mod text;
|
||
pub mod transition;
|
||
|
||
pub use inspect::{
|
||
Annotation, Attachment, AttachmentSource, DestView, DocInfo, Field, FieldKind, FontInfo, Layer, LayerOp, Link, LinkTarget, OutlineItem, PageInfo,
|
||
PageTransition, RemoteDestination, TransitionStyle, Xfa, attachment_data, check_pages, inspect, link_replies, pretty_date, thread_tops,
|
||
};
|
||
pub use pixels::Pixels;
|
||
pub use raster::{
|
||
MAX_PIXELS, MAX_SIDE, PRINT_TAG, PageRenderer, RenderConfig, RenderPool, RenderRequest, RenderStats, RenderWarning, RenderedPage, RequestKind,
|
||
Retiring, Tile, device_pixels, effective_scale,
|
||
};
|
||
pub use reading::{ReadingColors, ReadingParams};
|
||
pub use text::{PageText, TextGlyph};
|
||
|
||
/// Errors surfaced to the user when a document cannot be opened.
|
||
#[derive(Debug, thiserror::Error)]
|
||
pub enum OpenError {
|
||
#[error("the file is not a readable PDF: {0}")]
|
||
Invalid(String),
|
||
#[error("the document is protected by a password")]
|
||
NeedsPassword,
|
||
#[error("the password is incorrect")]
|
||
WrongPassword,
|
||
#[error("{0}")]
|
||
Unsupported(String),
|
||
}
|
||
|
||
#[cfg(test)]
|
||
mod lab_bradford_tests;
|