Apryse ships a native C++ DLL (PDFNetC.dll on Windows, libPDFNetC.so on Linux) alongside the managed wrapper. Remove both and add pdfluent to Cargo.toml.
<!-- .csproj -->
<PackageReference Include="PDFTron.NET" Version="10.4.0" />
<!-- Also requires PDFNetC.dll in your output directory --># Cargo.toml
[dependencies]
pdfluent = "1.1.0"Apryse requires calling PDFNet.Initialize() with a license key before any API use. PDFluent has nothing to initialise: no licence key, no environment variable, no activation call.
using Apryse;
// Must call before any Apryse API
PDFNet.Initialize("YOUR_LICENSE_KEY_HERE");// Set PDFLUENT_LICENSE env var, or configure in pdfluent.toml
// No explicit initialization call requiredApryse uses PDFDoc plus TextExtractor. PDFluent uses Document::open and page.text().
using Apryse;
using var doc = new PDFDoc("invoice.pdf");
doc.InitSecurityHandler();
var page = doc.GetPage(1);
var extractor = new TextExtractor();
extractor.Begin(page);
string text = extractor.GetAsText();
Console.WriteLine(text);use pdfluent::PdfDocument;
let doc = PdfDocument::open("invoice.pdf")?;
let text = doc.page(1)?.text()?;
println!("{}", text);Apryse uses doc.GetField() to retrieve and set individual field values. PDFluent hands out a mutable form handle with doc.form_mut(), with one setter per field type.
using var doc = new PDFDoc("form.pdf");
doc.InitSecurityHandler();
var field = doc.GetField("company_name");
field.SetValue("Acme Corp");
var dateField = doc.GetField("contract_date");
dateField.SetValue("2024-04-14");
doc.Save("form_filled.pdf", SDFDoc.SaveOptions.e_linearized);
PDFNet.Terminate();let mut doc = PdfDocument::open("form.pdf")?;
let mut form = doc.form_mut();
form.set_text("company_name", "Acme Corp")?;
form.set_text("contract_date", "2024-04-14")?;
doc.save("form_filled.pdf")?;Apryse Save() takes a SaveOptions flags enum. PDFluent save() writes to the output path with sane defaults.
doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
PDFNet.Terminate(); // must clean updoc.save("output.pdf")?;
// Rust drops doc automaticallyFoxit ships platform-specific DLLs or shared libraries that must travel with your application. PDFluent is a single Rust crate — cargo add pdfluent@1.1.0, and Cargo fetches and compiles it. No DLL to distribute, no shared library to load at runtime.
// C++ — Foxit SDK initialization
#include "include/fpdfview.h"
// fpdfview.dll / libfpdfview.so must be present at runtime
FPDF_InitLibrary();
FPDF_DOCUMENT doc = FPDF_LoadDocument("invoice.pdf", nullptr);
if (!doc) {
// handle load failure
}// Rust — PDFluent, no native library required
use pdfluent::PdfDocument;
let doc = PdfDocument::open("invoice.pdf")?;Foxit requires a license key passed at initialization time, and licensing is per seat. PDFluent needs no key at all: nothing is validated at startup, and a licence covers an organisation or a product rather than a seat. Delete the Foxit key initialisation and replace it with nothing.
// Foxit — license key required before any API use
FPDF_InitLibraryWithConfig(&config);
// License key must match purchased seat count
const char* key = "YOUR_FOXIT_LICENSE_KEY";
FPDF_UnlockDDS(key, (int)strlen(key));// PDFluent — no initialisation call, no licence key.
// The licence is a contract, not a file:
// See https://pdfluent.com/docs/licensing for the terms.Foxit operations map closely to PDFluent. Open a document, access pages by index, extract text or fill forms, and save. The main difference is error handling: Foxit returns null or numeric error codes; PDFluent returns Result types that the compiler forces you to handle.
FPDF_PAGE page = FPDF_LoadPage(doc, 0);
FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page);
int char_count = FPDFText_CountChars(text_page);
char16_t buf[4096];
FPDFText_GetText(text_page, 0, char_count, buf);
FPDFText_ClosePage(text_page);
FPDF_ClosePage(page);
FPDF_CloseDocument(doc);let text = doc.page(1)?.text()?;
println!("{}", text);
// All resources freed when doc goes out of scopeRemove the IronPdf NuGet package and add pdfluent to Cargo.toml. If your project is in C# you can call PDFluent through the C API or use the .NET binding package.
<!-- .csproj -->
<PackageReference Include="IronPdf" Version="2024.3.4" /># Cargo.toml
[dependencies]
pdfluent = "1.1.0"IronPDF uses PdfDocument.FromFile(). PDFluent uses Document::open.
using IronPdf;
var doc = PdfDocument.FromFile("report.pdf");
Console.WriteLine($"Pages: {doc.PageCount}");use pdfluent::PdfDocument;
let doc = PdfDocument::open("report.pdf")?;
println!("Pages: {}", doc.page_count());IronPDF drives Chromium to extract text, which can produce inconsistent results on non-HTML PDFs. PDFluent reads directly from the PDF content stream.
var doc = PdfDocument.FromFile("report.pdf");
// IronPDF text extraction routes through the browser engine
string allText = doc.ExtractAllText();
Console.WriteLine(allText);let doc = PdfDocument::open("report.pdf")?;
for i in 0..doc.page_count() {
let text = doc.page(i)?.text()?;
println!("{}", text);
}IronPDF uses Form.GetFieldByName(). PDFluent uses form_mut().set_text(), with set_checkbox, set_radio, set_dropdown and set_multi_select for the other field types.
var doc = PdfDocument.FromFile("application.pdf");
var nameField = doc.Form.GetFieldByName("applicant_name");
nameField.Value = "Jane Smith";
var dateField = doc.Form.GetFieldByName("submission_date");
dateField.Value = "2024-04-14";
doc.SaveAs("application_filled.pdf");let mut doc = PdfDocument::open("application.pdf")?;
let mut form = doc.form_mut();
form.set_text("applicant_name", "Jane Smith")?;
form.set_text("submission_date", "2024-04-14")?;
doc.save("application_filled.pdf")?;IronPDF uses SaveAs(). PDFluent uses Document::save().
doc.SaveAs("output.pdf");doc.save("output.pdf")?;Remove the iText Maven dependency and add PDFluent to your Rust project with cargo add.
<!-- pom.xml -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.2.5</version>
<type>pom</type>
</dependency># Cargo.toml
[dependencies]
pdfluent = "1.1.0"iText uses PdfReader and PdfDocument. PDFluent uses Document::open which returns a Result.
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfReader;
PdfDocument pdf = new PdfDocument(new PdfReader("report.pdf"));use pdfluent::PdfDocument;
let doc = PdfDocument::open("report.pdf")?;iText uses PdfTextExtractor with a LocationTextExtractionStrategy. PDFluent exposes a page-level extract_text method.
import com.itextpdf.kernel.pdf.canvas.parser.PdfTextExtractor;
import com.itextpdf.kernel.pdf.canvas.parser.listener.LocationTextExtractionStrategy;
String text = PdfTextExtractor.getTextFromPage(
pdf.getPage(1),
new LocationTextExtractionStrategy()
);let text = doc.page(1)?.text()?;iText uses PdfAcroForm.getField().setValue(). PDFluent uses form_mut().set_text(), with set_checkbox, set_radio, set_dropdown and set_multi_select for the other field types.
import com.itextpdf.forms.PdfAcroForm;
PdfAcroForm form = PdfAcroForm.getAcroForm(pdf, true);
form.getField("customer_name").setValue("Acme Corp");
form.getField("invoice_date").setValue("2024-04-14");let mut form = doc.form_mut();
form.set_text("customer_name", "Acme Corp")?;
form.set_text("invoice_date", "2024-04-14")?;iText writes to a PdfWriter. PDFluent uses Document::save.
import com.itextpdf.kernel.pdf.PdfWriter;
PdfDocument out = new PdfDocument(
new PdfReader("input.pdf"),
new PdfWriter("output.pdf")
);
// ... modifications ...
out.close();doc.save("output.pdf")?;