Modify text, add elements, fill forms, and update metadata — without re-generating the document from scratch. Pure Rust, no Adobe SDK, no Java.
use pdfluent::{Document, Font, Position, Metadata};
fn stamp_and_update(input: &[u8]) -> Vec<u8> {
let mut doc = Document::from_bytes(input)?;
// Add text to the first page
let page = doc.page_mut(0)?;
page.add_text(
"APPROVED — Finance Team",
Font::helvetica_bold(12),
Position::new(50.0, 50.0),
);
// Update document metadata
let mut meta = doc.metadata();
meta.set_author("Finance Team");
meta.set_keywords("approved, processed, 2026");
meta.set_custom("x-workflow-status", "approved");
doc.set_metadata(meta);
doc.save_bytes()
}Run cargo add pdfluent to get started.
Open an existing PDF and make targeted changes without rebuilding the document from scratch. Modify specific pages, add overlays, or update metadata while preserving the original content and structure.
Stamp text or place images on any page at any position. Useful for approval stamps, watermarks, barcodes, and dynamic overlays that need to land on top of existing content.
Read AcroForm field values, set new values programmatically, and flatten the form so the filled values become permanent page content. Works with text fields, checkboxes, radio buttons, and dropdowns.
Read and write the XMP metadata stream and the legacy document information dictionary in a single call. Set author, title, keywords, and custom namespace properties for classification or archiving pipelines.
Attach highlights, comments, stamps, and ink annotations to pages. Round-trip support: read existing annotations, modify them, and write them back without disturbing adjacent annotations.
PDFluent is a pure Rust crate. No Adobe SDK, no iText JAR, no libpoppler. Deploy to AWS Lambda, Cloudflare Workers, or any container that runs a Rust binary — without installing system packages.