Documentation
Everything you need
to build with PDFluent.
Guides, code examples, and API reference for PDF processing across six language channels.
Per-channel get-started
- Rust
cargo add pdfluent@1.5.1 - Python
pip install pdfluent==1.5.0 - WASM / JavaScript
npm install @pdfluent/sdk-wasm - .NET
dotnet add package PDFluent --version 1.5.0 - Java
com.pdfluent:pdfluent:1.5.0Version 1.5.0 is served from the PDFluent Maven repository at https://maven.pdfluent.com, so add it to your build next to the dependency. Maven Central carries 1.0.0; 1.1.x follows there later. - Node.js
npm install @pdfluent/node
Guides and API reference
Compliance
API by topic
Quick examples
Common operations to get started
Initialise & extract text
Rustuse pdfluent::PdfDocument;
let doc = PdfDocument::open("invoice.pdf")?;
// The full text, in reading order.
let text = doc.extract_text()?;
println!("{text}");
// Or per page.
for n in 0..doc.page_count() {
println!("--- page {} ---", n + 1);
println!("{}", doc.page(n)?.text()?);
}Flatten XFA form
Rustuse pdfluent::PdfDocument;
let mut doc = PdfDocument::open("tax_return.pdf")?;
// The form model: one row per logical field.
let model = doc.xfa_form_model()?;
for field in &model.fields {
println!("{} = {:?}", field.name, field.value);
}
// Fill by name.
doc.set_xfa_field_value("form1.name", pdfluent::xfa::XfaFieldValue::Text("Smith"))?;Convert & validate PDF/A
Rustuse pdfluent::{PdfAProfile, PdfDocument};
let doc = PdfDocument::open("legacy.pdf")?;
let report = doc.validate_pdfa(PdfAProfile::A2b)?;
if report.is_compliant() {
println!("conforms to PDF/A-2b");
} else {
for violation in &report.violations {
println!("{violation:?}");
}
}Sign a document (PAdES)
Rustuse pdfluent::signer::{PadesProfile, Pkcs12Signer, SignOptions};
use pdfluent::PdfDocument;
let mut doc = PdfDocument::open("contract.pdf")?;
let signer = Pkcs12Signer::from_pfx_file("cert.p12", "password")?;
// SignOptions::new() is PAdES B-B. For B-T or B-LT, use
// doc.sign_timestamped(..), which signs and then hands your timestamp
// authority the signature to stamp.
let opts = SignOptions::new()
.profile(PadesProfile::BasicSignature)
.reason("Approved");
doc.sign(&signer, opts)?;
doc.save("contract-signed.pdf")?;How-to guides
85+ step-by-step guides covering every PDF operation in Rust — merging, signing, OCR, PDF/A, XFA, and more.
Browse all guides →Error reference
Error codes with explanations, root causes, and fixes. Covers common issues in iText, PDFBox, IronPDF migrations too.
Browse errors →