Skip to main content

Crate justpdf

Crate justpdf 

Source
Expand description

§justpdf

Pure Rust PDF engine with a high-level API for reading, rendering, extracting text, creating, and modifying PDF documents.

§Quick Start

use justpdf::Document;

// Open and read
let doc = Document::open("input.pdf").unwrap();
println!("Pages: {}", doc.page_count());

// Extract text
let page = doc.page(0).unwrap();
println!("{}", page.text().unwrap());

// Render to PNG
let png = page.render_png(150.0).unwrap();
std::fs::write("page1.png", &png).unwrap();

Re-exports§

pub use justpdf_core as core;
pub use justpdf_render as render;

Structs§

Document
A high-level PDF document handle.
DocumentBuilder
High-level builder for creating complete PDF documents.
DocumentModifier
Modifier for existing PDF documents. Loads all objects from a PdfDocument, allows modification, then saves.
IndirectRef
A reference to an indirect PDF object: N M R.
Modifier
Document modifier for editing existing PDFs.
Page
A single page of a PDF document.
PageBuilder
Builder for constructing a single PDF page with content streams.
PageIter
Iterator over document pages.
PdfDict
An ordered dictionary of PDF objects, keyed by name bytes.
RenderOptions

Enums§

Error
High-level error type for the justpdf crate.
JustPdfError
All errors that can occur in justpdf-core.
OutputFormat
Output format for rendering.
PdfObject
A PDF object value.

Functions§

embed_jpeg
Embed a JPEG image into the document.
embed_png
Embed a PNG image into the document.
merge
Merge multiple PDF files into one.
merge_bytes
Merge PDF documents from in-memory byte vectors.
merge_documents
Merge pages from multiple PDF documents into one.

Type Aliases§

Result
A specialized Result type for justpdf operations.