Skip to main content

Crate mioffice_pdf_utils

Crate mioffice_pdf_utils 

Source
Expand description

§mioffice-pdf-utils

Lightweight PDF utilities for Rust — merge, split, extract pages, and read metadata. Pure Rust with zero native dependencies.

Built by MiOffice.ai — the AI office suite where files never leave your browser.

§Quick Start

use mioffice_pdf_utils::{merge_pdfs, get_metadata};
use std::fs;

let pdf1 = fs::read("doc1.pdf").unwrap();
let pdf2 = fs::read("doc2.pdf").unwrap();
let merged = merge_pdfs(&[&pdf1, &pdf2]).unwrap();
fs::write("merged.pdf", merged).unwrap();

let meta = get_metadata(&pdf1).unwrap();
println!("Pages: {}, Title: {:?}", meta.page_count, meta.title);

Re-exports§

pub use lopdf;

Structs§

PageSize
Width and height of a PDF page in points (1 point = 1/72 inch).
PdfMetadata
PDF metadata extracted from the document info dictionary.

Enums§

PdfError

Functions§

extract_pages
Extract specific pages from a PDF. Pages are 0-indexed.
get_metadata
Get metadata and page information from a PDF.
merge_pdfs
Merge multiple PDF byte slices into a single PDF.
split_pdf
Split a PDF into individual single-page PDFs.

Type Aliases§

Result