Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
pdfium-bind
Rust FFI bindings and a high-level wrapper for PDFium.
Designed for ease of distribution: This crate eliminates the need for users to manually install PDFium on their systems. It embeds prebuilt PDFium binaries directly into your executable.
Features
dynamic(Default): Embeds the PDFium dynamic library within your binary. At runtime, it extracts the library to a temporary file and loads it.static: Links PDFium statically at build time.
Configuration
You can override the PDFium library and headers used during build by setting the following environment variables:
PDFIUM_STATIC_LIB_PATH: Path tolibpdfium.a(forstaticfeature).PDFIUM_DYNAMIC_LIB_PATH: Path to the dynamic library (e.g.,.so,.dylib, or.dll) (fordynamicfeature).PDFIUM_INCLUDE_PATH: Path to the directory containing PDFium headers (required if any of the above are set).
If these variables are not set, the build script will automatically download the appropriate PDFium binary for your platform.
Usage
use PdfDocument;
use Path;
Windows-specific Cache Cleanup
When using the dynamic feature on Windows, the PDFium DLL is extracted to a temporary location. If you want to ensure this file is cleaned up when your application exits, you can call:
cleanup_cache;
On Unix platforms, the temporary file is deleted immediately after being loaded into memory.
Automatic Downloads
The crate automatically downloads pre-built PDFium binaries for supported platforms:
- Dynamic linking: Downloads from bblanchon/pdfium-binaries.
- Static linking: Downloads from paulocoutinhox/pdfium-lib (currently macOS only).
Supported Platforms
- macOS (aarch64, x86_64)
- Linux (x86_64, aarch64)
- Windows (x86_64, aarch64, x86)