Skip to main content

caj2pdf_core/
lib.rs

1// SPDX-License-Identifier: MIT
2
3//! Platform-neutral, bounded I/O contracts for CAJ-family conversion.
4//!
5//! Format implementations are separate from these contracts. A source must
6//! expose a stable size and positioned reads; the output is any
7//! [`std::io::Write`], which receives bytes in order. Forward-only input must
8//! be spooled by a platform adapter or rejected explicitly.
9
10#![forbid(unsafe_code)]
11
12pub mod arith;
13pub mod caj;
14mod error;
15mod fallible;
16mod gb18030;
17pub mod hnc8;
18mod io;
19pub mod jbig1;
20pub mod jbig2;
21pub mod kdh;
22mod limits;
23pub mod native;
24mod operations;
25pub mod pdf;
26pub mod qm;
27#[cfg(test)]
28pub(crate) mod test_support;
29
30pub use error::{Context, Error, ErrorKind, Hnc8Stage, Result, Type3Stage};
31pub(crate) use io::write_counted;
32pub use io::{
33    Cancellation, CountingSource, NeverCancel, Payload, RangedSource, read_exact_at, read_payload,
34};
35pub use limits::{DEFAULT_IO_CHUNK, Limits, MAX_IO_CHUNK};
36pub use operations::{
37    Bookmark, BookmarkVisitor, ConversionOptions, ConversionReport, Detection, DocumentInfo,
38    FONTS_REQUIRE_HNC8, Fonts, ImageCounts, InputFormat, InspectOptions, OmittedPage,
39    PDF_HEADER_SEARCH_BYTES, PageVisitor, Progress, SIGNATURE_BYTES, Structure, convert,
40    convert_with_ttkn_response, detect_format, detect_source, index_pdf, inspect, inspect_pages,
41    native_font_mode, needs_fonts, read_outline,
42};
43
44/// Shared defaults for versioned native-text font resources.
45pub mod bundled_fonts;