iText 7 and Apache PDFBox are two long-established Java PDF libraries. Both are mature and well-documented, but both require a JVM at runtime. iText 7 is AGPL-licensed, which requires commercial users to either open-source their application or purchase a commercial license. PDFBox is Apache-licensed and free, but has no XFA support and limited form-filling capability. PDFluent is a Rust crate: no JVM, WASM-compatible, and available under AGPLv3 or a commercial license.
use pdfluent::PdfDocument;
fn main() -> pdfluent::Result<()> {
let mut doc = PdfDocument::open("invoice.pdf")?;
// Extract text from page 1
let text = doc.page(1)?.text()?;
println!("{}", text);
// Fill a form field
doc.form_mut().set_text("invoice_number", "INV-2024-001")?;
doc.save("invoice_filled.pdf")?;
Ok(())
}import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.forms.PdfAcroForm;
import com.itextpdf.kernel.pdf.canvas.parser.PdfTextExtractor;
import com.itextpdf.kernel.pdf.canvas.parser.listener
.LocationTextExtractionStrategy;
// Requires a JVM, which starts before the first call in Lambda
public class InvoiceProcessor {
public static void main(String[] args) throws Exception {
PdfDocument pdf = new PdfDocument(
new PdfReader("invoice.pdf"),
new PdfWriter("invoice_filled.pdf")
);
// Extract text from page 1
String text = PdfTextExtractor.getTextFromPage(
pdf.getPage(1),
new LocationTextExtractionStrategy()
);
System.out.println(text);
// Fill a form field
PdfAcroForm form = PdfAcroForm.getAcroForm(pdf, true);
form.getField("invoice_number")
.setValue("INV-2024-001");
pdf.close(); // must explicitly close
}
}| Feature | PDFluent | Java PDF Libraries (iText / PDFBox) |
|---|---|---|
| Runtime required | None (static binary) | JVM (Java 11+) |
| Cold start (serverless) | No runtime to start; opening a file: 1.7 ms median on one MacBook (A22, 2026-08-24) | JVM startup on every cold invocation |
| Base memory usage | No JVM | Requires a JVM |
| WASM / browser support | ||
| Serverless deploy without runtime layer | ||
| AcroForm filling | iText: yes / PDFBox: partial | |
| XFA forms | iText (add-on) / PDFBox: no | |
| Price published, bought with a card | iText: no / PDFBox: N/A | |
| Published pricing | iText: no / PDFBox: free (Apache) | |
| License | AGPLv3 or commercial | iText: AGPL / PDFBox: Apache-2.0 |
PDFluent is the right choice for new Rust projects, serverless deployments where cold starts matter, applications targeting WASM or browser environments, and commercial products that want to avoid the iText AGPL license. It is also the right choice when consolidating a mixed Java PDF stack.
iText or PDFBox are reasonable if you have a large existing Java codebase, your team knows Java deeply, and you are running on always-warm JVM servers where cold start latency is not a concern. PDFBox is a practical choice for Apache-licensed projects that only need basic reading and text extraction.
iText is feature-rich but AGPL-licensed — commercial users must purchase a license or open-source their application. PDFBox is free but limited on forms and has no XFA support. Both require a JVM, which adds cold-start latency, increases memory use, and complicates serverless and WASM deployments. PDFluent matches or exceeds both on features, runs without a JVM, and adds WASM support that Java cannot provide.
Free under the AGPLv3, or a commercial licence if you would rather not publish your own source.