Cargo Features

[dependencies]
lopdf = { version = "0.39.0", default-features = false, features = ["async", "chrono", "embed_image", "jiff", "wasm_js", "serde", "time", "rayon"] }
default = chrono, jiff, rayon, time

These default features are set whenever lopdf is added without default-features = false somewhere in the dependency tree.

async

Enables macros and rt-multi-thread of tokio

chrono default

Enables chrono

embed_image = image

Affects xobject::image, xobject::image_from

jiff default

Enables jiff

wasm_js

Enables wasm_js of getrandom ^0.3

getrandom:

Optional backend: wasm_js

This flag enables the wasm_js backend and uses it by default on wasm32 where the target_os is unknown. The getrandom_backend cfg may override this.

WARNING: We strongly recommend against enabling this feature in libraries (except for tests) since it is known to break non-Web WASM builds and further since the usage of wasm-bindgen causes significant bloat to Cargo.lock (on all targets).

The only exception to this rule: if your crate already unconditionally depends on wasm-bindgen or js-sys on "unknown" WASM targets then it's acceptable to enable this feature unconditionally.

serde

Enables serde

time default

Enables time

Affects creator::tests.get_timestamp

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

image embed_image?
rayon default
tokio async?