A step-by-step guide for replacing IronPDF with PDFluent. Covers dependency setup, opening PDFs, text extraction, form filling, and saving.
cargo add pdfluentRemove 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 = "0.9"IronPDF uses PdfDocument.FromFile(). PDFluent uses Document::open.
using IronPdf;
var doc = PdfDocument.FromFile("report.pdf");
Console.WriteLine($"Pages: {doc.PageCount}");use pdfluent::Document;
let doc = Document::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 = Document::open("report.pdf")?;
for i in 0..doc.page_count() {
let text = doc.page(i)?.extract_text()?;
println!("{}", text);
}IronPDF uses Form.GetFieldByName(). PDFluent uses acroform().set_field().
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 = Document::open("application.pdf")?;
let mut form = doc.acroform()?;
form.set_field("applicant_name", "Jane Smith")?;
form.set_field("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")?;