Files
pdfcraft/crates/render/src/lib.rs
T
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

51 lines
2.1 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 uses the shared `craft-pdf` facade over `hayro`
//! (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 backend;
mod inspect;
mod link_area;
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,
MAX_GROUP_DEPTH, OutlineItem, PageInfo, PageTransition, Popup, Portfolio, PortfolioView, RemoteDestination, ReviewStates, TransitionStyle, Xfa,
attachment_data, check_pages, fill_group_text, group_primaries, inspect, link_replies, named_destination, pretty_date, thread_tops,
};
pub use link_area::{MAX_LINK_QUADS, MAX_URI_BASE_BYTES, link_quads, quad_contains, resolve_uri};
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;