Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / pdf / src / main / rust / Cargo.toml

Cargo.toml60 lines · 2.8 KiBRaw
1[package]
2name = "pdf_render"
3version = "0.1.0"
4edition = "2021"
5description = "Memory-safe PDF content-stream interpreter (lopdf) for the 'Open PDF (safe)' viewer, exposed to Kotlin via JNI"
6license = "GPL-2.0-only"
7
8[lib]
9name = "pdf_render"
10crate-type = ["cdylib"]
11
12[dependencies]
13# Root catalog pins single version per crate (see /Cargo.toml)
14# armv8-only: aarch64-linux-android target, no windows/wasm deps in normal edges.
15# lopdf default includes chrono->windows-link + jiff + time + rayon – not needed for core filter/crypto/image extraction path we use in safe viewer.
16# Trim default to only serde (still safe for XObject parsing). Date fields fallback to None if feature disabled.
17lopdf = { workspace = true, default-features = false, features = ["serde"] }
18ttf-parser = { workspace = true, default-features = false, features = ["std", "glyph-names"] }
19jni.workspace = true
20jni_bridge = { path = "../../../../library/jni-bridge/src/main/rust" }
21jpeg-decoder.workspace = true
22fax.workspace = true
23flate2.workspace = true
24hayro-jbig2 = { workspace = true, default-features = false, features = ["std"] }
25
26openjp2.workspace = true
27md-5.workspace = true
28aes.workspace = true
29sha2 = { workspace = true, features = ["oid"] }
30indexmap.workspace = true
31getrandom.workspace = true
32memmap2.workspace = true
33
34# Signing (features preserved per no-feature-loss)
35# PDF signature *creation* removed as a feature – dropped rsa/cms/x509-cert/spki/const-oid
36# (and their num-bigint-dig/pkcs1/pkcs8/signature/sha1/spin/lazy_static/num-iter subtree).
37# der + rand stay: der is used pervasively for ASN.1 (fonts/filters/decrypt), rand is used
38# by decrypt.rs (OsRng) for encryption. const-oid still comes in transitively via der.
39rand.workspace = true
40rand_core.workspace = true
41der.workspace = true
42
43[dev-dependencies]
44# Independent reference renderer for `reference_diff_tests.rs`. TEST-ONLY.
45#
46# Every other test in this crate is self-referential: it asserts the renderer
47# does what this team decided it should do, so a clause misread the same way by
48# the implementer and by the reviewers passes every test. `hayro` is a second,
49# unrelated implementation of the same spec (pure Rust, CPU-only via vello_cpu,
50# `#![forbid(unsafe_code)]`, Apache-2.0 OR MIT — the MIT arm is compatible with
51# this crate's GPL-2.0-only, and a dev-dependency is not distributed anyway).
52#
53# It CANNOT reach the shipped cdylib: cargo only builds dev-dependencies for
54# test/bench/example targets, never for `--lib`. Verified with
55# cargo tree -p pdf_render --edges normal --target aarch64-linux-android
56# which does not mention hayro. See the module header of
57# `src/reference_diff_tests.rs` for the full argument and the caveat that
58# `hayro-jbig2` is a SHARED component (also a normal dependency above), so JBIG2
59# is deliberately outside the differential corpus.
60hayro.workspace = true