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

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

Cargo.toml58 lines · 2.7 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
20jpeg-decoder.workspace = true
21fax.workspace = true
22flate2.workspace = true
23hayro-jbig2 = { workspace = true, default-features = false, features = ["std"] }
24
25openjp2.workspace = true
26md-5.workspace = true
27aes.workspace = true
28sha2 = { workspace = true, features = ["oid"] }
29indexmap.workspace = true
30getrandom.workspace = true
31
32# Signing (features preserved per no-feature-loss)
33# PDF signature *creation* removed as a feature – dropped rsa/cms/x509-cert/spki/const-oid
34# (and their num-bigint-dig/pkcs1/pkcs8/signature/sha1/spin/lazy_static/num-iter subtree).
35# der + rand stay: der is used pervasively for ASN.1 (fonts/filters/decrypt), rand is used
36# by decrypt.rs (OsRng) for encryption. const-oid still comes in transitively via der.
37rand.workspace = true
38rand_core.workspace = true
39der.workspace = true
40
41[dev-dependencies]
42# Independent reference renderer for `reference_diff_tests.rs`. TEST-ONLY.
43#
44# Every other test in this crate is self-referential: it asserts the renderer
45# does what this team decided it should do, so a clause misread the same way by
46# the implementer and by the reviewers passes every test. `hayro` is a second,
47# unrelated implementation of the same spec (pure Rust, CPU-only via vello_cpu,
48# `#![forbid(unsafe_code)]`, Apache-2.0 OR MIT — the MIT arm is compatible with
49# this crate's GPL-2.0-only, and a dev-dependency is not distributed anyway).
50#
51# It CANNOT reach the shipped cdylib: cargo only builds dev-dependencies for
52# test/bench/example targets, never for `--lib`. Verified with
53# cargo tree -p pdf_render --edges normal --target aarch64-linux-android
54# which does not mention hayro. See the module header of
55# `src/reference_diff_tests.rs` for the full argument and the caveat that
56# `hayro-jbig2` is a SHARED component (also a normal dependency above), so JBIG2
57# is deliberately outside the differential corpus.
58hayro.workspace = true