Migrate XFA-based PDF forms to modern standards with PDFluent. Flatten, convert, and extract data from XFA 3.3 forms without Adobe dependencies.
// Planned 1.1 surface — see note above.
// 1.0-compatible variant: fill AcroForm fields + save.
use pdfluent::prelude::*;
fn main() -> Result<()> {
let mut doc = PdfDocument::open("belastingaangifte_2024.pdf")?;
{
let mut form = doc.form_mut();
form.set_text("bsn", "123456782")?
.set_text("name", "Test User")?;
}
doc.save("belastingaangifte_2024_filled.pdf")?;
Ok(())
}Run cargo add [email protected] to get started.
The only pure-Rust XFA engine in existence. Parse, render, and flatten dynamic forms without Adobe libraries or a browser dependency.
Execute FormCalc expressions in-process. Field calculations, cross-field validation, and conditional visibility — all evaluated server-side.
Extract structured form data as JSON or XML. Map XFA field names to your schema. Works on partially-filled forms and forms with SOM expressions.
Convert dynamic XFA forms to static PDFs that open in any reader. Preserves layout, fonts, and filled values without Adobe Reader.
The XFA engine compiles to a ~3MB WASM bundle. Process legacy forms in the browser without server uploads — useful for GDPR-sensitive documents.
No JVM warmup. No garbage collection on burst workloads. Process thousands of XFA forms per minute on a single server instance.