PDF libraries for Rust
- lopdf loads a PDF into a document of objects you can read and edit: merge, delete and rotate pages, extract text, change metadata, compress and save with object streams. It also builds new documents at the object level. MIT.
- pdf (pdf-rs) parses PDFs into typed Rust structures (catalog, pages, resources, fonts, images, forms). Good for inspecting files; writing is experimental. MIT.
- printpdf creates PDFs with text, embedded and subset fonts, shapes, images and SVG, and has a simple HTML layout mode. MIT.
- pdfium-render wraps Google’s PDFium: render pages to images, extract text, fill forms, merge and create documents. Needs a PDFium library at run time. MIT or Apache 2.0.
Pick pdfium-render for rendering and reliable text extraction, lopdf to modify files in pure Rust, printpdf to generate documents. For plain text extraction in pure Rust, pdf-extract builds on lopdf.
- lopdf lopdf is a Rust library to read, edit and write PDF files at the object level. How to add it, extract text, create a PDF, delete and rotate pages.
- pdf (pdf-rs) The pdf crate (pdf-rs) parses PDF files into typed Rust structures. How to add it, open a PDF, read metadata, list pages, page sizes and fonts.
- pdfium-render pdfium-render is a high-level Rust wrapper for Google's PDFium. How to set it up, render PDF pages to images, extract text, read metadata, merge.
- printpdf printpdf is a Rust library for creating PDF documents with text, fonts, shapes and images. How to add it, create a PDF with text, embed a TrueType font.