Files
pdfcraft/crates/render/src/lib.rs
T
mtlcl410andClaude Opus 5.5 2117186687 M2: the Layers panel presents the configuration's /Order tree (ISO 32000-2 Table 99)
The panel listed every group in /OCGs, flat. Table 99 says only the groups
/Order lists are presented, nested arrays as a tree, and a leading text
string in a nested array as a non-selectable label; in the default
configuration /Order defaults to the empty array.

- render: DocInfo::layer_order, rows of LayerRow { depth, item } where an
  item is a layer (index into DocInfo::layers) or a label. A nested array's
  entries are one level deeper than the layer or label before them. At most
  4096 rows, 32 levels and 256 characters a label; an indirect array is read
  once, so cycles end. DocInfo::layers is unchanged: unlisted groups keep
  their state, draw, print and answer layer_set and set-layer actions.
- ui-egui: the Layers panel draws the rows, indented 16 points a level, a
  label as a heading that can't be toggled; the count is the layers shown.
  A document whose /Order lists none says so.
- automation: doc_info reports layer_order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC
2026-10-31 14:13:35 +08:00

48 lines
1.8 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! 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;
mod system_font;
pub mod text;
pub mod transition;
pub use inspect::{
Annotation, Attachment, AttachmentSource, DestView, DocInfo, Field, FieldKind, FontInfo, Layer, LayerItem, LayerOp, LayerRow, 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;