How to Migrate from PdfiumViewer to IronPDF in C#
Migrating from PdfiumViewer to IronPDF moves your .NET PDF workflow from a Windows Forms viewer/renderer wrapper around Google's PDFium — with native binary dependencies and only page-level text extraction — to a comprehensive PDF solution that handles creation, manipulation, full text extraction, and rendering across all .NET application types. This guide provides a complete, step-by-step migration path that eliminates platform restrictions while adding capabilities that PdfiumViewer was never designed to provide.
Why Migrate from PdfiumViewer to IronPDF
Understanding PdfiumViewer
PdfiumViewer (NuGet package PdfiumViewer, repo pvginkel/PdfiumViewer, Apache 2.0) is a .NET wrapper around Google's PDFium rendering engine — the same engine used inside Chrome — exposing PDF viewing and rasterization for Windows Forms applications.
PdfiumViewer is a viewer and renderer, not a generator. It does not support PDF creation, editing, or manipulation, and its text API (PdfDocument.GetPdfText(int page)) returns raw page text without layout or per-word coordinates. The upstream repository was archived by its maintainer on August 2, 2019 and the last NuGet release (2.13.0) shipped on November 6, 2017 — existing code keeps working, but there are no further fixes, .NET 6+ updates, or CVE patches coming.
Critical PdfiumViewer Limitations
-
Viewer / renderer only: Cannot create PDFs from HTML, images, or programmatically. PdfiumViewer's capabilities are limited to viewing and rasterization — it does not support PDF creation, editing, merging, or other manipulative functions.
-
Windows Forms / Windows only: Built around
System.Drawingand WinForms controls; not designed for other UI frameworks, andSystem.Drawing.Commonis Windows-only on .NET 6+. -
No PDF manipulation: Cannot merge, split, or modify PDF content.
-
Native binary dependencies: Requires platform-specific PDFium binaries via
PdfiumViewer.Native.x86.v8-xfaandPdfiumViewer.Native.x86_64.v8-xfa(or the no-V8 / no-XFA variants). -
Archived upstream: Repo archived 2019-08-02; last NuGet release 2.13.0 (2017-11-06); no further updates.
-
Page-level text extraction only:
PdfDocument.GetPdfText(int page)returns raw page text — no per-word coordinates, no layout reconstruction, and no OCR for image-only PDFs. -
No HTML to PDF: PDFium does not parse HTML. To produce a PDF from HTML you need a separate generator (wkhtmltopdf, IronPDF, PuppeteerSharp, etc.) and can then load the result with PdfiumViewer for display or rasterization.
-
No headers/footers: Cannot add page numbers or repeating content.
-
No watermarks: Cannot stamp documents with overlays.
- No security features: Cannot encrypt or password-protect PDFs.
PdfiumViewer vs IronPDF Comparison
| Aspect | PdfiumViewer | IronPDF |
|---|---|---|
| Primary Focus | WinForms PDF viewer | Complete PDF solution |
| License | Apache 2.0 | Commercial |
| PDF Creation | ✗ | ✓ (HTML, URL, images) |
| PDF Manipulation | ✗ | ✓ (merge, split, edit) |
| HTML to PDF | ✗ | ✓ (Chromium engine) |
| Text Extraction | Page-level only (GetPdfText) |
Full (with layout, per-page) |
| Watermarks | ✗ | ✓ |
| Headers/Footers | ✗ | ✓ |
| Security | ✗ | ✓ |
| Built-in Viewer | ✓ | ✗ (backend-focused) |
| Platform Support | Windows / WinForms only | Console, Web, Desktop, cross-platform |
| Framework Support | .NET Framework 2.0+ | .NET Framework, Core, 5+ |
| Maintenance | Archived 2019-08-02 (last release 2017-11-06) | Active |
For teams targeting modern .NET, IronPDF provides a comprehensive, actively maintained foundation that works across all .NET application types, eliminating the Windows Forms restriction and native binary complexity.
Before You Start
Prerequisites
- .NET Environment: .NET Framework 4.6.2+ or .NET Core 3.1+ / .NET 5/6/7/8/9+
- NuGet Access: Ability to install NuGet packages
- IronPDF License: Obtain your license key from ironpdf.com
NuGet Package Changes
# Remove PdfiumViewer packages
dotnet remove package PdfiumViewer
dotnet remove package PdfiumViewer.Native.x86.v8-xfa
dotnet remove package PdfiumViewer.Native.x86_64.v8-xfa
# Install IronPDF
dotnet add package IronPdf
# Remove PdfiumViewer packages
dotnet remove package PdfiumViewer
dotnet remove package PdfiumViewer.Native.x86.v8-xfa
dotnet remove package PdfiumViewer.Native.x86_64.v8-xfa
# Install IronPDF
dotnet add package IronPdf
License Configuration
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
' Add at application startup (Program.vb or Startup.vb)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Identify PdfiumViewer Usage
# Find PdfiumViewer usage
grep -r "PdfiumViewer\|PdfViewer\|PdfDocument\.Load" --include="*.cs" .
# Find native binary references
grep -r "pdfium\.dll\|Native\.x86\|Native\.x64" --include="*.csproj" .
# Find viewer control usage
grep -r "PdfViewer" --include="*.cs" --include="*.Designer.cs" .
# Find PdfiumViewer usage
grep -r "PdfiumViewer\|PdfViewer\|PdfDocument\.Load" --include="*.cs" .
# Find native binary references
grep -r "pdfium\.dll\|Native\.x86\|Native\.x64" --include="*.csproj" .
# Find viewer control usage
grep -r "PdfViewer" --include="*.cs" --include="*.Designer.cs" .
Complete API Reference
Namespace Changes
// PdfiumViewer
using PdfiumViewer;
// IronPDF
using IronPdf;
using IronPdf.Rendering;
using IronPdf.Editing;
// PdfiumViewer
using PdfiumViewer;
// IronPDF
using IronPdf;
using IronPdf.Rendering;
using IronPdf.Editing;
Imports PdfiumViewer
Imports IronPdf
Imports IronPdf.Rendering
Imports IronPdf.Editing
Core Class Mappings
| PdfiumViewer | IronPDF |
|---|---|
PdfDocument |
PdfDocument |
PdfViewer |
(no equivalent) |
PdfRenderer |
ChromePdfRenderer |
| (not available) | HtmlHeaderFooter |
Document Loading Mappings
| PdfiumViewer | IronPDF |
|---|---|
PdfDocument.Load(path) |
PdfDocument.FromFile(path) |
PdfDocument.Load(stream) |
PdfDocument.FromStream(stream) |
PdfDocument.Load(path, password) |
PdfDocument.FromFile(path, password) |
| (no bytes overload — wrap in MemoryStream) | PdfDocument.FromBinaryData(bytes) |
Document Properties Mappings
| PdfiumViewer | IronPDF |
|---|---|
document.PageCount |
document.PageCount |
document.PageSizes[i] |
document.Pages[i].Width/Height |
document.GetPdfText(pageIndex) |
pdf.Pages[pageIndex].Text |
Page Rendering Mappings
| PdfiumViewer | IronPDF |
|---|---|
document.Render(pageIndex, dpiX, dpiY, forPrinting) |
pdf.ToBitmap(pageIndex) |
document.Render(pageIndex, width, height, dpiX, dpiY, flags) |
pdf.RasterizeToImageFiles(path, dpi) |
Saving Documents Mappings
| PdfiumViewer | IronPDF |
|---|---|
document.Save(path) |
pdf.SaveAs(path) |
document.Save(stream) |
new MemoryStream(pdf.BinaryData) |
| (not available) | pdf.BinaryData (returns byte[]) |
New or Substantially Expanded Features vs PdfiumViewer
| IronPDF Feature | Description |
|---|---|
pdf.ExtractAllText() |
Whole-document text extraction (PdfiumViewer offers page-level GetPdfText only) |
pdf.ExtractTextFromPage(index) |
Extract text from specific page |
ChromePdfRenderer.RenderHtmlAsPdf() |
Create from HTML |
ChromePdfRenderer.RenderUrlAsPdf() |
Create from URL |
PdfDocument.Merge() |
Combine PDFs |
pdf.CopyPages() |
Extract pages |
pdf.RemovePages() |
Delete pages |
pdf.ApplyWatermark() |
Add watermarks |
pdf.AddHtmlHeaders() |
Add headers |
pdf.AddHtmlFooters() |
Add footers |
pdf.SecuritySettings |
Password protection |
pdf.Form |
Form filling |
Code Migration Examples
Example 1: Text Extraction from PDF
Before (PdfiumViewer):
// NuGet: Install-Package PdfiumViewer
// Install-Package PdfiumViewer.Native.x86.v8-xfa
// Install-Package PdfiumViewer.Native.x86_64.v8-xfa
using PdfiumViewer;
using System;
using System.Text;
string pdfPath = "document.pdf";
// PdfiumViewer exposes page-level text extraction via
// PdfDocument.GetPdfText(int page). It returns raw page text only —
// no layout, no per-word coordinates, no OCR for image-only pages.
using (var document = PdfDocument.Load(pdfPath))
{
int pageCount = document.PageCount;
Console.WriteLine($"Total pages: {pageCount}");
var sb = new StringBuilder();
for (int i = 0; i < pageCount; i++)
{
string pageText = document.GetPdfText(i);
sb.AppendLine($"--- Page {i + 1} ---");
sb.AppendLine(pageText);
}
Console.WriteLine(sb.ToString());
}
// NuGet: Install-Package PdfiumViewer
// Install-Package PdfiumViewer.Native.x86.v8-xfa
// Install-Package PdfiumViewer.Native.x86_64.v8-xfa
using PdfiumViewer;
using System;
using System.Text;
string pdfPath = "document.pdf";
// PdfiumViewer exposes page-level text extraction via
// PdfDocument.GetPdfText(int page). It returns raw page text only —
// no layout, no per-word coordinates, no OCR for image-only pages.
using (var document = PdfDocument.Load(pdfPath))
{
int pageCount = document.PageCount;
Console.WriteLine($"Total pages: {pageCount}");
var sb = new StringBuilder();
for (int i = 0; i < pageCount; i++)
{
string pageText = document.GetPdfText(i);
sb.AppendLine($"--- Page {i + 1} ---");
sb.AppendLine(pageText);
}
Console.WriteLine(sb.ToString());
}
Imports PdfiumViewer
Imports System
Imports System.Text
Dim pdfPath As String = "document.pdf"
' PdfiumViewer exposes page-level text extraction via
' PdfDocument.GetPdfText(int page). It returns raw page text only —
' no layout, no per-word coordinates, no OCR for image-only pages.
Using document As PdfDocument = PdfDocument.Load(pdfPath)
Dim pageCount As Integer = document.PageCount
Console.WriteLine($"Total pages: {pageCount}")
Dim sb As New StringBuilder()
For i As Integer = 0 To pageCount - 1
Dim pageText As String = document.GetPdfText(i)
sb.AppendLine($"--- Page {i + 1} ---")
sb.AppendLine(pageText)
Next
Console.WriteLine(sb.ToString())
End Using
After (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
string pdfPath = "document.pdf";
// Open and extract text from PDF
PdfDocument pdf = PdfDocument.FromFile(pdfPath);
// Extract text from all pages
string allText = pdf.ExtractAllText();
Console.WriteLine("Extracted Text:");
Console.WriteLine(allText);
// Extract text from specific page
string pageText = pdf.ExtractTextFromPage(0);
Console.WriteLine($"\nFirst page text: {pageText}");
Console.WriteLine($"\nTotal pages: {pdf.PageCount}");
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
string pdfPath = "document.pdf";
// Open and extract text from PDF
PdfDocument pdf = PdfDocument.FromFile(pdfPath);
// Extract text from all pages
string allText = pdf.ExtractAllText();
Console.WriteLine("Extracted Text:");
Console.WriteLine(allText);
// Extract text from specific page
string pageText = pdf.ExtractTextFromPage(0);
Console.WriteLine($"\nFirst page text: {pageText}");
Console.WriteLine($"\nTotal pages: {pdf.PageCount}");
Imports IronPdf
Imports System
Module Program
Sub Main()
Dim pdfPath As String = "document.pdf"
' Open and extract text from PDF
Dim pdf As PdfDocument = PdfDocument.FromFile(pdfPath)
' Extract text from all pages
Dim allText As String = pdf.ExtractAllText()
Console.WriteLine("Extracted Text:")
Console.WriteLine(allText)
' Extract text from specific page
Dim pageText As String = pdf.ExtractTextFromPage(0)
Console.WriteLine(vbCrLf & "First page text: " & pageText)
Console.WriteLine(vbCrLf & "Total pages: " & pdf.PageCount)
End Sub
End Module
PdfiumViewer's text API is PdfDocument.GetPdfText(int page) — page-level raw text only, no layout reconstruction, no per-word coordinates, and no OCR fallback for image-only PDFs. Anything beyond a flat-text dump requires either custom layout heuristics or a different library.
IronPDF provides whole-document extraction via ExtractAllText() and per-page extraction via ExtractTextFromPage(index) (or pdf.Pages[index].Text). See the text extraction documentation for additional options.
Example 2: HTML to PDF Conversion
Before (PdfiumViewer):
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
// PdfiumViewer wraps Google's PDFium — a renderer, not a generator.
// PDFium does not parse HTML, so PdfiumViewer has no HTML-to-PDF path.
// To produce a PDF from HTML you need a separate generator (wkhtmltopdf,
// IronPDF, PuppeteerSharp, etc.), then load the result with PdfiumViewer
// for display or rasterization.
string htmlContent = "<h1>Hello World</h1><p>This is a test document.</p>";
// Pretend "output.pdf" was produced by another tool — load and render it.
string existingPdfPath = "output.pdf";
using (var document = PdfDocument.Load(existingPdfPath))
{
Console.WriteLine($"Loaded PDF with {document.PageCount} page(s).");
// PdfDocument.Render(int page, float dpiX, float dpiY, bool forPrinting)
var image = document.Render(0, 300, 300, true);
Console.WriteLine("Rendered page 1 at 300 DPI.");
}
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
// PdfiumViewer wraps Google's PDFium — a renderer, not a generator.
// PDFium does not parse HTML, so PdfiumViewer has no HTML-to-PDF path.
// To produce a PDF from HTML you need a separate generator (wkhtmltopdf,
// IronPDF, PuppeteerSharp, etc.), then load the result with PdfiumViewer
// for display or rasterization.
string htmlContent = "<h1>Hello World</h1><p>This is a test document.</p>";
// Pretend "output.pdf" was produced by another tool — load and render it.
string existingPdfPath = "output.pdf";
using (var document = PdfDocument.Load(existingPdfPath))
{
Console.WriteLine($"Loaded PDF with {document.PageCount} page(s).");
// PdfDocument.Render(int page, float dpiX, float dpiY, bool forPrinting)
var image = document.Render(0, 300, 300, true);
Console.WriteLine("Rendered page 1 at 300 DPI.");
}
Imports PdfiumViewer
Imports System
' PdfiumViewer wraps Google's PDFium — a renderer, not a generator.
' PDFium does not parse HTML, so PdfiumViewer has no HTML-to-PDF path.
' To produce a PDF from HTML you need a separate generator (wkhtmltopdf,
' IronPDF, PuppeteerSharp, etc.), then load the result with PdfiumViewer
' for display or rasterization.
Dim htmlContent As String = "<h1>Hello World</h1><p>This is a test document.</p>"
' Pretend "output.pdf" was produced by another tool — load and render it.
Dim existingPdfPath As String = "output.pdf"
Using document As PdfDocument = PdfDocument.Load(existingPdfPath)
Console.WriteLine($"Loaded PDF with {document.PageCount} page(s).")
' PdfDocument.Render(int page, float dpiX, float dpiY, bool forPrinting)
Dim image = document.Render(0, 300, 300, True)
Console.WriteLine("Rendered page 1 at 300 DPI.")
End Using
After (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
string htmlContent = "<h1>Hello World</h1><p>This is a test document.</p>";
// Create a PDF from HTML string
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);
// Save the PDF
pdf.SaveAs("output.pdf");
Console.WriteLine("PDF created successfully!");
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
string htmlContent = "<h1>Hello World</h1><p>This is a test document.</p>";
// Create a PDF from HTML string
var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);
// Save the PDF
pdf.SaveAs("output.pdf");
Console.WriteLine("PDF created successfully!");
Imports IronPdf
Imports System
Module Program
Sub Main()
Dim htmlContent As String = "<h1>Hello World</h1><p>This is a test document.</p>"
' Create a PDF from HTML string
Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf(htmlContent)
' Save the PDF
pdf.SaveAs("output.pdf")
Console.WriteLine("PDF created successfully!")
End Sub
End Module
This is the largest capability gap. PDFium does not parse HTML, so PdfiumViewer has no HTML-to-PDF path — you would generate the PDF with another tool first and then use PdfiumViewer to display or rasterize it.
IronPDF provides native HTML to PDF conversion through ChromePdfRenderer, which uses a Chromium engine internally for HTML, CSS, and JavaScript rendering. RenderHtmlAsPdf() converts HTML strings, RenderUrlAsPdf() captures URLs, and RenderHtmlFileAsPdf() reads HTML files. See the HTML to PDF documentation for comprehensive examples.
Example 3: PDF to Image Conversion
Before (PdfiumViewer):
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
using System.Drawing;
using System.Drawing.Imaging;
string pdfPath = "document.pdf";
string outputImage = "page1.png";
// PDFiumViewer excels at rendering PDFs to images
using (var document = PdfDocument.Load(pdfPath))
{
// Render first page at 300 DPI
int dpi = 300;
using (var image = document.Render(0, dpi, dpi, true))
{
// Save as PNG
image.Save(outputImage, ImageFormat.Png);
Console.WriteLine($"Page rendered to {outputImage}");
}
// Render all pages
for (int i = 0; i < document.PageCount; i++)
{
using (var pageImage = document.Render(i, 150, 150, true))
{
pageImage.Save($"page_{i + 1}.png", ImageFormat.Png);
}
}
}
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
using System.Drawing;
using System.Drawing.Imaging;
string pdfPath = "document.pdf";
string outputImage = "page1.png";
// PDFiumViewer excels at rendering PDFs to images
using (var document = PdfDocument.Load(pdfPath))
{
// Render first page at 300 DPI
int dpi = 300;
using (var image = document.Render(0, dpi, dpi, true))
{
// Save as PNG
image.Save(outputImage, ImageFormat.Png);
Console.WriteLine($"Page rendered to {outputImage}");
}
// Render all pages
for (int i = 0; i < document.PageCount; i++)
{
using (var pageImage = document.Render(i, 150, 150, true))
{
pageImage.Save($"page_{i + 1}.png", ImageFormat.Png);
}
}
}
Imports PdfiumViewer
Imports System
Imports System.Drawing
Imports System.Drawing.Imaging
Module Module1
Sub Main()
Dim pdfPath As String = "document.pdf"
Dim outputImage As String = "page1.png"
' PDFiumViewer excels at rendering PDFs to images
Using document = PdfDocument.Load(pdfPath)
' Render first page at 300 DPI
Dim dpi As Integer = 300
Using image = document.Render(0, dpi, dpi, True)
' Save as PNG
image.Save(outputImage, ImageFormat.Png)
Console.WriteLine($"Page rendered to {outputImage}")
End Using
' Render all pages
For i As Integer = 0 To document.PageCount - 1
Using pageImage = document.Render(i, 150, 150, True)
pageImage.Save($"page_{i + 1}.png", ImageFormat.Png)
End Using
Next
End Using
End Sub
End Module
After (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Linq;
string pdfPath = "document.pdf";
string outputImage = "page1.png";
// Open PDF and convert to images
PdfDocument pdf = PdfDocument.FromFile(pdfPath);
// Convert first page to image
var firstPageImage = pdf.ToBitmap(0);
firstPageImage[0].Save(outputImage);
Console.WriteLine($"Page rendered to {outputImage}");
// Convert all pages to images
var allPageImages = pdf.ToBitmap();
for (int i = 0; i < allPageImages.Length; i++)
{
allPageImages[i].Save($"page_{i + 1}.png");
Console.WriteLine($"Saved page {i + 1}");
}
Console.WriteLine($"Total pages converted: {pdf.PageCount}");
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Linq;
string pdfPath = "document.pdf";
string outputImage = "page1.png";
// Open PDF and convert to images
PdfDocument pdf = PdfDocument.FromFile(pdfPath);
// Convert first page to image
var firstPageImage = pdf.ToBitmap(0);
firstPageImage[0].Save(outputImage);
Console.WriteLine($"Page rendered to {outputImage}");
// Convert all pages to images
var allPageImages = pdf.ToBitmap();
for (int i = 0; i < allPageImages.Length; i++)
{
allPageImages[i].Save($"page_{i + 1}.png");
Console.WriteLine($"Saved page {i + 1}");
}
Console.WriteLine($"Total pages converted: {pdf.PageCount}");
Imports IronPdf
Imports System
Imports System.Linq
Module Module1
Sub Main()
Dim pdfPath As String = "document.pdf"
Dim outputImage As String = "page1.png"
' Open PDF and convert to images
Dim pdf As PdfDocument = PdfDocument.FromFile(pdfPath)
' Convert first page to image
Dim firstPageImage = pdf.ToBitmap(0)
firstPageImage(0).Save(outputImage)
Console.WriteLine($"Page rendered to {outputImage}")
' Convert all pages to images
Dim allPageImages = pdf.ToBitmap()
For i As Integer = 0 To allPageImages.Length - 1
allPageImages(i).Save($"page_{i + 1}.png")
Console.WriteLine($"Saved page {i + 1}")
Next
Console.WriteLine($"Total pages converted: {pdf.PageCount}")
End Sub
End Module
This is one area where PdfiumViewer excels—PDF rendering to images is its primary strength. Both libraries handle this task effectively, but with different patterns.
PdfiumViewer uses document.Render(pageIndex, dpiX, dpiY, forPrinting) with nested using statements for proper disposal. You need to import System.Drawing and System.Drawing.Imaging for the ImageFormat enum.
IronPDF uses pdf.ToBitmap(pageIndex) which returns a bitmap array. The pattern is simpler without nested disposal requirements. For batch operations, ToBitmap() without parameters returns all pages. You can also use RasterizeToImageFiles() for direct file output. See the PDF to image documentation for additional rendering options.
Native Dependency Removal
One of the significant benefits of migrating from PdfiumViewer to IronPDF is eliminating native binary management.
Before (PdfiumViewer) - Complex Deployment
MyApp/
├── bin/
│ ├── MyApp.dll
│ ├── PdfiumViewer.dll
│ ├── x86/
│ │ └── pdfium.dll
│ └── x64/
│ └── pdfium.dll
After (IronPDF) - Clean Deployment
MyApp/
├── bin/
│ ├── MyApp.dll
│ └── IronPdf.dll # Everything included
Remove Native Binary References
# Delete native PDFium binaries
rm -rf x86/ x64/ runtimes/
# Remove from .csproj native package references
# <PackageReference Include="PdfiumViewer.Native.x86.v8-xfa" />
# <PackageReference Include="PdfiumViewer.Native.x64.v8-xfa" />
# Delete native PDFium binaries
rm -rf x86/ x64/ runtimes/
# Remove from .csproj native package references
# <PackageReference Include="PdfiumViewer.Native.x86.v8-xfa" />
# <PackageReference Include="PdfiumViewer.Native.x64.v8-xfa" />
Critical Migration Notes
No Built-in Viewer Control
IronPDF is backend-focused and does not include a visual PDF viewer control:
// PdfiumViewer: Built-in viewer control
pdfViewer.Document = document;
// IronPDF: Use external viewer or web-based approach
pdf.SaveAs(tempPath);
Process.Start(new ProcessStartInfo(tempPath) { UseShellExecute = true });
// PdfiumViewer: Built-in viewer control
pdfViewer.Document = document;
// IronPDF: Use external viewer or web-based approach
pdf.SaveAs(tempPath);
Process.Start(new ProcessStartInfo(tempPath) { UseShellExecute = true });
' PdfiumViewer: Built-in viewer control
pdfViewer.Document = document
' IronPDF: Use external viewer or web-based approach
pdf.SaveAs(tempPath)
Process.Start(New ProcessStartInfo(tempPath) With {.UseShellExecute = True})
For viewing needs, consider using Process.Start() to open in the default PDF viewer, a WebBrowser control with the PDF path, or third-party viewer controls like Syncfusion, DevExpress, or Telerik.
Document Loading Method Change
// PdfiumViewer
PdfDocument.Load(path)
// IronPDF
PdfDocument.FromFile(path)
// PdfiumViewer
PdfDocument.Load(path)
// IronPDF
PdfDocument.FromFile(path)
' PdfiumViewer
PdfDocument.Load(path)
' IronPDF
PdfDocument.FromFile(path)
Save Method Change
// PdfiumViewer
document.Save(path)
// IronPDF
pdf.SaveAs(path)
// PdfiumViewer
document.Save(path)
// IronPDF
pdf.SaveAs(path)
Render Method Change
// PdfiumViewer: Returns image with nested using
using (var image = document.Render(0, 150, 150, true))
{
image.Save("page.png", ImageFormat.Png);
}
// IronPDF: Returns bitmap array
var images = pdf.ToBitmap(0);
images[0].Save("page.png");
// PdfiumViewer: Returns image with nested using
using (var image = document.Render(0, 150, 150, true))
{
image.Save("page.png", ImageFormat.Png);
}
// IronPDF: Returns bitmap array
var images = pdf.ToBitmap(0);
images[0].Save("page.png");
Imports System.Drawing.Imaging
' PdfiumViewer: Returns image with nested using
Using image = document.Render(0, 150, 150, True)
image.Save("page.png", ImageFormat.Png)
End Using
' IronPDF: Returns bitmap array
Dim images = pdf.ToBitmap(0)
images(0).Save("page.png")
Page Size Access Change
// PdfiumViewer
var size = document.PageSizes[index];
Console.WriteLine($"{size.Width} x {size.Height}");
// IronPDF
var page = pdf.Pages[index];
Console.WriteLine($"{page.Width} x {page.Height}");
// PdfiumViewer
var size = document.PageSizes[index];
Console.WriteLine($"{size.Width} x {size.Height}");
// IronPDF
var page = pdf.Pages[index];
Console.WriteLine($"{page.Width} x {page.Height}");
' PdfiumViewer
Dim size = document.PageSizes(index)
Console.WriteLine($"{size.Width} x {size.Height}")
' IronPDF
Dim page = pdf.Pages(index)
Console.WriteLine($"{page.Width} x {page.Height}")
Feature Comparison Summary
| Feature | PdfiumViewer | IronPDF |
|---|---|---|
| Load PDF | ✓ | ✓ |
| Render to Image | ✓ | ✓ |
| Built-in Viewer | ✓ | ✗ |
| Print PDF | ✓ | ✓ |
| Extract Text | Page-level (GetPdfText) |
Full (ExtractAllText, per-page) |
| Create from HTML | ✗ | ✓ |
| Create from URL | ✗ | ✓ |
| Merge PDFs | ✗ | ✓ |
| Split PDFs | ✗ | ✓ |
| Add Watermarks | ✗ | ✓ |
| Headers/Footers | ✗ | ✓ |
| Form Filling | ✗ | ✓ |
| Password Protection | ✗ | ✓ |
| WinForms Support | ✓ | ✓ |
| ASP.NET Support | ✗ | ✓ |
| .NET Core Support | Limited (System.Drawing tied to Windows) | ✓ |
| Active Maintenance | Archived 2019-08-02 | ✓ |
Migration Checklist
Pre-Migration
- Identify all PdfiumViewer usage in codebase
- List WinForms using PdfViewer control
- Document current rendering DPI settings
- Check for native binary references
- Identify print functionality usage
- Plan viewer control replacement strategy
- Obtain IronPDF license key
Package Changes
- Remove
PdfiumViewerNuGet package - Remove
PdfiumViewer.Native.x86.v8-xfapackage - Remove
PdfiumViewer.Native.x86_64.v8-xfapackage - Delete native pdfium.dll binaries from x86/ and x64/ folders
- Install
IronPdfNuGet package:dotnet add package IronPdf
Code Changes
- Add license key configuration at startup
- Replace
PdfDocument.Load()withPdfDocument.FromFile() - Replace
document.Save()withpdf.SaveAs() - Replace
document.Render()withpdf.ToBitmap()orRasterizeToImageFiles() - Replace
document.PageSizes[i]withpdf.Pages[i].Width/Height - Replace PdfViewer control with external viewer or Process.Start()
- Add new capabilities (text extraction, HTML to PDF, etc.)
Post-Migration
- Test rendering output quality
- Test printing functionality
- Test on target platforms
- Add new features (HTML to PDF, merging, watermarks, security)
- Update documentation

