IRONSOFTWAREHOME
MIGRATION GUIDES

How to Migrate from PDFView4NET to IronPDF in C#

Curtis Chau
Curtis Chau
Updated: August 1, 2026

Migrating from PDFView4NET to IronPDF moves your PDF workflow from a WinForms/WPF viewing component to a headless PDF generation and manipulation library. This guide provides a step-by-step migration path that enables server-side processing, web application support, and broader PDF lifecycle management beyond what PDFView4NET's view/render/print scope covers.

Why Migrate from PDFView4NET to IronPDF

Understanding PDFView4NET

PDFView4NET (O2 Solutions, o2sol.com) is a viewer / render / print toolkit for WinForms and WPF applications. It ships as two NuGet packages - O2S.Components.PDFView4NET.Win and O2S.Components.PDFView4NET.WPF - and includes its own PDF rendering engine. O2 Solutions sells a separate library, PDF4NET, for programmatic creation/manipulation; this guide covers PDFView4NET only.

Teams that need PDF generation, HTML-to-PDF rendering, or server-side workflows often pair PDFView4NET with another library, or migrate outright to a toolkit such as IronPDF that covers creation and manipulation as well as headless deployment scenarios.

The View / Render / Print Scope

PDFView4NET is built around displaying, rendering and printing PDFs, plus annotation and form-filling. Common reasons to migrate:

  1. View / Render / Print Focus: PDFView4NET loads existing PDFs for display, printing, or image rendering. It does not generate PDFs from HTML or URLs.
  2. UI Framework Dependency: Distributed in WinForms and WPF editions; both target Windows desktop, which limits usage in console workers or server-side hosts.
  3. No HTML to PDF: There is no HtmlToPdfConverter or HTML rendering API in O2S.Components.PDFView4NET.
  4. Limited Manipulation: Manipulation is centered on annotations and form fields rather than full content authoring.
  5. No Linux / Docker / Server Path: The toolkit is Windows-only via WinForms/WPF and is not designed for ASP.NET hosts on Linux or container workloads.
  6. Active, but Narrow: O2 Solutions still ships releases; the product is maintained, but its scope is intentionally narrow.

PDFView4NET vs IronPDF Comparison

FeaturePDFView4NETIronPDF
Primary FocusPDF ViewingComplete PDF Solution (Create, View, Edit)
UI Frameworks RequiredWinForms, WPFNone
PDF CreationNoYes
PDF ManipulationLimited (Annotations)Yes
Server-SideNot SupportedFull Support
Web ApplicationsNoYes
Console AppsLimitedFull Support
Azure/DockerNoYes
HTML to PDFNoYes
Cross-Platform ContextNoYes
Ease of IntegrationMediumHigh

IronPDF covers PDF creation, manipulation, and rendering on top of viewing-adjacent workflows, addressing use cases that extend beyond the view/render/print scope of PDFView4NET.

IronPDF is also context-independent - it runs in web applications, services, and console applications on Windows, Linux, macOS, Docker, and Azure, which can matter for projects that need cross-platform support or server-side hosting.


Before You Start

Prerequisites

  1. .NET Environment: .NET Framework 4.6.2+ or .NET Core 3.1+ / .NET 5/6/7/8/9+
  2. NuGet Access: Ability to install NuGet packages
  3. IronPDF License: Obtain your license key from ironpdf.com

NuGet Package Changes

<!-- Remove PDFView4NET (the actual NuGet IDs are split by UI framework) -->
<PackageReference Include="O2S.Components.PDFView4NET.Win" Version="*" Remove />
<!-- or for WPF: O2S.Components.PDFView4NET.WPF -->

<!-- Add IronPDF -->
<PackageReference Include="IronPdf" Version="*" />
XML

Or via CLI:

dotnet remove package O2S.Components.PDFView4NET.Win
# (use O2S.Components.PDFView4NET.WPF for the WPF edition)
dotnet add package IronPdf
SHELL

License Configuration

// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";

Complete API Reference

Namespace Changes

// Before: PDFView4NET
using O2S.Components.PDFView4NET;

// After: IronPDF
using IronPdf;

Core API Mappings

PDFView4NETIronPDF
new PDFDocument(); doc.Load(path)PdfDocument.FromFile(path)
new PDFDocument(); doc.Load(stream)PdfDocument.FromStream(stream)
document.Pages[index]pdf.Pages[index]
document.PageCountpdf.PageCount
document.Print(...)pdf.Print()
document.Close()pdf.Dispose()
N/A in PDFView4NETChromePdfRenderer (HTML to PDF)
N/A in PDFView4NETPdfDocument.Merge()
N/A in PDFView4NETpdf.ApplyWatermark()
document.SecurityManagerpdf.SecuritySettings

Code Migration Examples

Example 1: URL to PDF Conversion

Before (PDFView4NET):

// NuGet: Install-Package O2S.Components.PDFView4NET.Win
using O2S.Components.PDFView4NET;
using System;

class Program
{
    static void Main()
    {
        // PDFView4NET cannot fetch a URL and emit a PDF; it can only consume one.
        PDFDocument document = new PDFDocument();
        document.Load("input.pdf");
        Console.WriteLine($"Loaded {document.PageCount} page(s) for view/print.");
        document.Close();
    }
}

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://example.com");
        pdf.SaveAs("output.pdf");
    }
}

PDFView4NET has no HTML/URL rendering surface - there is no HtmlToPdfConverter in O2S.Components.PDFView4NET, so a URL must be rendered to PDF by another tool first and then loaded for view/print. IronPDF handles the whole conversion with a single ChromePdfRenderer.RenderUrlAsPdf() call that returns a PdfDocument you save with SaveAs(). See the HTML to PDF documentation for comprehensive examples.

Example 2: HTML String to PDF Conversion

Before (PDFView4NET):

// NuGet: Install-Package O2S.Components.PDFView4NET.Win
using O2S.Components.PDFView4NET;
using System;

class Program
{
    static void Main()
    {
        // The HTML string cannot be rendered by PDFView4NET. Assume an upstream
        // tool produced "document.pdf"; PDFView4NET can then display or print it.
        PDFDocument document = new PDFDocument();
        document.Load("document.pdf");
        Console.WriteLine($"Document ready for viewing — {document.PageCount} page(s).");
        document.Close();
    }
}

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        string htmlContent = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("document.pdf");
    }
}

There is no HtmlContent property or HTML rendering API in O2S.Components.PDFView4NET, so the HTML string has to be produced as PDF elsewhere and then loaded into the viewer. IronPDF accepts the HTML string directly via RenderHtmlAsPdf() and returns a PdfDocument. Learn more in our tutorials.

Example 3: Text Extraction from PDF

Before (PDFView4NET):

// NuGet: Install-Package O2S.Components.PDFView4NET.Win
using O2S.Components.PDFView4NET;
using System;
using System.IO;

class Program
{
    static void Main()
    {
        using (FileStream fs = File.OpenRead("document.pdf"))
        {
            PDFDocument document = new PDFDocument();
            document.Load(fs);
            string text = "";
            for (int i = 0; i < document.PageCount; i++)
            {
                text += document.Pages[i].ExtractText();
            }
            Console.WriteLine(text);
            document.Close();
        }
    }
}

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var pdf = PdfDocument.FromFile("document.pdf");
        string text = pdf.ExtractAllText();
        Console.WriteLine(text);
    }
}

This example highlights a significant API difference. PDFView4NET requires creating a FileStream, instantiating PDFDocument and calling Load(fs), then iterating document.PageCount and concatenating Pages[i].ExtractText() per page.

IronPDF simplifies this dramatically: PdfDocument.FromFile() loads the PDF directly from a path, and ExtractAllText() extracts text from all pages in a single method call. No manual stream management, no loops, no string concatenation - just two lines of code.


Critical Migration Notes

HTML Rendering Surface

PDFView4NET has no HTML-to-PDF API. IronPDF introduces ChromePdfRenderer for HTML/URL input:

// IronPDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
// or: renderer.RenderUrlAsPdf(url);
pdf.SaveAs("output.pdf");

Document Loading Change

// PDFView4NET: instantiate then Load(path) or Load(stream)
PDFDocument document = new PDFDocument();
document.Load("document.pdf");

// IronPDF: Direct file path
var pdf = PdfDocument.FromFile("document.pdf");

Page Access Change

// PDFView4NET: document.PageCount and document.Pages[i]
for (int i = 0; i < document.PageCount; i++)
{
    document.Pages[i].ExtractText();
}

// IronPDF: pdf.PageCount and Pages[i] or ExtractAllText()
string text = pdf.ExtractAllText();
// Or per-page: pdf.ExtractTextFromPage(0);

Save Method Change

// PDFView4NET has no save-from-HTML path; saving applies after edits on a loaded document.
// IronPDF: SaveAs()
pdf.SaveAs("output.pdf");

New Capabilities After Migration

After migrating to IronPDF, you gain capabilities that PDFView4NET cannot provide:

PDF Merging

var pdf1 = PdfDocument.FromFile("chapter1.pdf");
var pdf2 = PdfDocument.FromFile("chapter2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("complete_book.pdf");

Watermarks with HTML

var pdf = PdfDocument.FromFile("document.pdf");
pdf.ApplyWatermark(@"
    <div style='
        font-size: 72pt;
        color: rgba(255, 0, 0, 0.2);
        transform: rotate(-45deg);
    '>
        CONFIDENTIAL
    </div>");
pdf.SaveAs("watermarked.pdf");

Password Protection

var pdf = PdfDocument.FromFile("document.pdf");
pdf.SecuritySettings.OwnerPassword = "owner123";
pdf.SecuritySettings.UserPassword = "user456";
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SaveAs("protected.pdf");

Form Filling

var pdf = PdfDocument.FromFile("form.pdf");
pdf.Form.FindFormField("FirstName").Value = "John";
pdf.Form.FindFormField("LastName").Value = "Doe";
pdf.SaveAs("filled_form.pdf");

Server-Side Processing

PDFView4NET cannot run in server environments. IronPDF excels here:

// ASP.NET Core
[HttpGet]
public IActionResult GeneratePdf()
{
    var renderer = new ChromePdfRenderer();
    var pdf = renderer.RenderHtmlAsPdf(GetReportHtml());
    return File(pdf.BinaryData, "application/pdf", "report.pdf");
}

Feature Comparison Summary

FeaturePDFView4NETIronPDF
View PDFsYes (UI)No (use viewer)
Load PDFsYesYes
Save PDFsLimitedYes
HTML to PDFNoYes
URL to PDFNoYes
Merge PDFsNoYes
Split PDFsLimitedYes
WatermarksNoYes
Headers/FootersNoYes
Password ProtectionNoYes
Digital SignaturesNoYes
Text ExtractionLimitedYes
Fill FormsLimitedYes
WinFormsYesYes
WPFYesYes
ConsoleLimitedYes
ASP.NETNoYes
AzureNoYes
DockerNoYes

Migration Checklist

Pre-Migration

  • Identify viewing requirements (determine if IronPDF's capabilities can replace UI-based PDF viewing)
  • Document printing workflows
  • List PDF manipulation needs
  • Plan viewer replacement if needed (IronPDF focuses on generation/manipulation)
  • Obtain IronPDF license key from ironpdf.com

Package Changes

  • Remove O2S.Components.PDFView4NET.Win (or .WPF) NuGet package
  • Install IronPdf NuGet package: dotnet add package IronPdf

Code Changes

  • Update namespace imports (using O2S.Components.PDFView4NET;using IronPdf;)
  • Introduce ChromePdfRenderer for any HTML or URL input (no PDFView4NET equivalent)
  • Replace new PDFDocument(); document.Load(path) with PdfDocument.FromFile(path)
  • Replace new PDFDocument(); document.Load(stream) with PdfDocument.FromStream(stream)
  • Replace manual for (int i = 0; i < document.PageCount; i++) text extraction with pdf.ExtractAllText() (or pdf.ExtractTextFromPage(i))
  • Replace document.Close() with pdf.Dispose() (or a using block)
  • Add license initialization at application startup

Post-Migration

  • Test PDF loading and saving
  • Verify text extraction functionality
  • Test HTML to PDF conversion
  • Verify server deployment works (new capability)
  • Test cross-platform if needed (new capability)
  • Remove UI-specific PDF code if server-only

Please note: PDFView4NET is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by O2 Solutions. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.
Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Related Articles

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required