Solutions

Edit existing PDFs in Rust.

Modify text, add elements, fill forms, and update metadata — without re-generating the document from scratch. Pure Rust, no Adobe SDK, no Java.

Code example

rust
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.

What it does

Edit without re-generating

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.

Add text and images

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.

Fill and flatten form fields

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.

Update XMP and DocInfo metadata

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.

Add annotations

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.

No native dependencies

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.

Deployment options

AWS LambdaCloudflare Workers (WASM)Docker / KubernetesBare metal serversDenoWebAssembly (browser)

Frequently asked questions