[package] name = "pdf_render" version = "0.1.0" edition = "2021" description = "Memory-safe PDF content-stream interpreter (lopdf) for the 'Open PDF (safe)' viewer, exposed to Kotlin via JNI" license = "GPL-2.0-only" [lib] name = "pdf_render" crate-type = ["cdylib"] [dependencies] # Root catalog pins single version per crate (see /Cargo.toml) # armv8-only: aarch64-linux-android target, no windows/wasm deps in normal edges. # lopdf default includes chrono->windows-link + jiff + time + rayon – not needed for core filter/crypto/image extraction path we use in safe viewer. # Trim default to only serde (still safe for XObject parsing). Date fields fallback to None if feature disabled. lopdf = { workspace = true, default-features = false, features = ["serde"] } ttf-parser = { workspace = true, default-features = false, features = ["std", "glyph-names"] } jni.workspace = true jpeg-decoder.workspace = true fax.workspace = true flate2.workspace = true hayro-jbig2 = { workspace = true, default-features = false, features = ["std"] } openjp2.workspace = true md-5.workspace = true aes.workspace = true sha2 = { workspace = true, features = ["oid"] } indexmap.workspace = true getrandom.workspace = true # Signing (features preserved per no-feature-loss) # PDF signature *creation* removed as a feature – dropped rsa/cms/x509-cert/spki/const-oid # (and their num-bigint-dig/pkcs1/pkcs8/signature/sha1/spin/lazy_static/num-iter subtree). # der + rand stay: der is used pervasively for ASN.1 (fonts/filters/decrypt), rand is used # by decrypt.rs (OsRng) for encryption. const-oid still comes in transitively via der. rand.workspace = true rand_core.workspace = true der.workspace = true [dev-dependencies] # Independent reference renderer for `reference_diff_tests.rs`. TEST-ONLY. # # Every other test in this crate is self-referential: it asserts the renderer # does what this team decided it should do, so a clause misread the same way by # the implementer and by the reviewers passes every test. `hayro` is a second, # unrelated implementation of the same spec (pure Rust, CPU-only via vello_cpu, # `#![forbid(unsafe_code)]`, Apache-2.0 OR MIT — the MIT arm is compatible with # this crate's GPL-2.0-only, and a dev-dependency is not distributed anyway). # # It CANNOT reach the shipped cdylib: cargo only builds dev-dependencies for # test/bench/example targets, never for `--lib`. Verified with # cargo tree -p pdf_render --edges normal --target aarch64-linux-android # which does not mention hayro. See the module header of # `src/reference_diff_tests.rs` for the full argument and the caveat that # `hayro-jbig2` is a SHARED component (also a normal dependency above), so JBIG2 # is deliberately outside the differential corpus. hayro.workspace = true