/pdf

Rust library to read, manipulate and write PDF files.

Primary LanguageRustMIT LicenseMIT

pdf-rs Build Status

Read, alter and write PDF files.

At the moment, you can only read PDF files.

One easy way you can contribute is to add different PDF files to tests/files and see if they pass the tests (cargo test).

Feel free to contribute with ideas, issues or code! Please join us on Zulip if you have any questions or problems.

Building

See fonts.md if you want to support the 14 standard fonts.

Workspace

This repository uses a Cargo Workspace and default members. This means by default only the pdf library is build. To build additional parts, pass --package=read to build the subcrate you are interested in (here the read example).

Examples

Currently we only have two very minimal examples read and text. However the library has grown a lot since they have been written.

Inspect

There is a tool for visualizing a PDF file as an interactive hierarchy of primitives at inspect-prim. Just clone and cargo run.

Viewer

run it: cargo run -p pdf_view --release YOUR_FILE.pdf Right now you can change pages with left and right arrow keys and zoom with '+' and '-'. Works for some files.