qpdf-rs
Overview
This project contains Rust safe bindings to a popular QPDF C++ library.
It uses the QPDF C API exposed via qpdf-c.h
header.
Tested on the following targets:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
- aarch64-apple-darwin
The prebuilt bindings for those targets are included in the source tree.
By default, pkg-config
will be used to link against the system library libqpdf
.
If the vendored
feature is enabled, a vendored source tree of qpdf is built and linked statically.
The legacy
feature enables bindings to the r2/3/4 encryption options which are available in qpdf 10.x but not 11.x.
Usage example
use *;
Additional build requirements
- C/C++ compiler
- For the targets which do not have prebuilt bindgen bindings:
- Installed clang/llvm (with
libclang
shared library) for bindgen build-time invocation - For cross-compilation a custom sysroot must be passed to clang via
BINDGEN_EXTRA_CLANG_ARGS
environment variable, for example:BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/x86_64-w64-mingw32/sys-root"
- Installed clang/llvm (with
License
Licensed under Apache 2.0 license.