Skip to content

Install

lamina isn’t published to npm or crates.io yet. Until it is, use it from a checkout of the repository, which needs Rust (the toolchain in rust-toolchain.toml installs itself), Node 22 or newer and pnpm.

Build the WebAssembly modules and the package once:

Terminal window
pnpm install
cargo xtask wasm # builds packages/wasm/dist/ and packages/pdf/dist/, then tests them

Then use one of these:

  • A tarball: run pnpm pack in packages/wasm and in packages/pdf, then add both .tgz files to your project. @lamina/pdf depends on @lamina/wasm, so install both tarballs at once.
  • A workspace dependency: inside this repository, add "@lamina/pdf": "workspace:*" to a package under packages/ or apps/.

The package is ESM only. It has one entry per runtime (the workerd, deno, browser, node and default export conditions), and each entry loads the .wasm its own way. The quick starts show each one.

Add a path dependency on the façade crate:

[dependencies]
lamina = { path = "../lamina/crates/lamina" }

A git dependency (lamina = { git = "…" }) works too, once you can read the repository. The default features are text (fonts and text, which includes the builder and text extraction) and saslprep (passwords for AES-256 files). For reading and editing only, use default-features = false.