Migrate from IronPDF to PDFluent

A step-by-step guide for replacing IronPDF with PDFluent. Covers dependency setup, opening PDFs, text extraction, form filling, and saving.

Migrating from IronPDF to PDFluent. Install with cargo add pdfluent

Migration steps

1

Replace the dependency

Remove 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.

IronPDF (before)
<!-- .csproj -->
<PackageReference Include="IronPdf" Version="2024.3.4" />
PDFluent (after)
# Cargo.toml
[dependencies]
pdfluent = "0.9"
2

Open an existing PDF

IronPDF uses PdfDocument.FromFile(). PDFluent uses Document::open.

IronPDF (before)
using IronPdf;

var doc = PdfDocument.FromFile("report.pdf");
Console.WriteLine($"Pages: {doc.PageCount}");
PDFluent (after)
use pdfluent::Document;

let doc = Document::open("report.pdf")?;
println!("Pages: {}", doc.page_count());
3

Extract text

IronPDF drives Chromium to extract text, which can produce inconsistent results on non-HTML PDFs. PDFluent reads directly from the PDF content stream.

IronPDF (before)
var doc = PdfDocument.FromFile("report.pdf");

// IronPDF text extraction routes through the browser engine
string allText = doc.ExtractAllText();
Console.WriteLine(allText);
PDFluent (after)
let doc = Document::open("report.pdf")?;

for i in 0..doc.page_count() {
    let text = doc.page(i)?.extract_text()?;
    println!("{}", text);
}
4

Fill AcroForm fields

IronPDF uses Form.GetFieldByName(). PDFluent uses acroform().set_field().

IronPDF (before)
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");
PDFluent (after)
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")?;
5

Save the document

IronPDF uses SaveAs(). PDFluent uses Document::save().

IronPDF (before)
doc.SaveAs("output.pdf");
PDFluent (after)
doc.save("output.pdf")?;

Things to watch out for

  • !IronPDF's primary feature is HTML-to-PDF rendering via Chromium. PDFluent does not provide HTML-to-PDF conversion.
  • !IronPDF licenses per developer per year. PDFluent uses a flat subscription model.
  • !IronPDF requires the Chromium binary to be present on the server. PDFluent has no native dependencies.

Frequently asked questions