Skip to footer content
MIGRATION GUIDES

How to Migrate from PDFView4NET to IronPDF in C#

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

Feature PDFView4NET IronPDF
Primary Focus PDF Viewing Complete PDF Solution (Create, View, Edit)
UI Frameworks Required WinForms, WPF None
PDF Creation No Yes
PDF Manipulation Limited (Annotations) Yes
Server-Side Not Supported Full Support
Web Applications No Yes
Console Apps Limited Full Support
Azure/Docker No Yes
HTML to PDF No Yes
Cross-Platform Context No Yes
Ease of Integration Medium High

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


<PackageReference Include="O2S.Components.PDFView4NET.Win" Version="*" Remove />

<PackageReference Include="IronPdf" Version="*" />

<PackageReference Include="O2S.Components.PDFView4NET.Win" Version="*" Remove />

<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
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";
// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
' Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
$vbLabelText   $csharpLabel

Complete API Reference

Namespace Changes

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

// After: IronPDF
using IronPdf;
// Before: PDFView4NET
using O2S.Components.PDFView4NET;

// After: IronPDF
using IronPdf;
Imports IronPdf
$vbLabelText   $csharpLabel

Core API Mappings

PDFView4NET IronPDF
new PDFDocument(); doc.Load(path) PdfDocument.FromFile(path)
new PDFDocument(); doc.Load(stream) PdfDocument.FromStream(stream)
document.Pages[index] pdf.Pages[index]
document.PageCount pdf.PageCount
document.Print(...) pdf.Print()
document.Close() pdf.Dispose()
N/A in PDFView4NET ChromePdfRenderer (HTML to PDF)
N/A in PDFView4NET PdfDocument.Merge()
N/A in PDFView4NET pdf.ApplyWatermark()
document.SecurityManager pdf.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();
    }
}
// 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();
    }
}
Imports O2S.Components.PDFView4NET
Imports System

Class Program
    Shared Sub Main()
        ' PDFView4NET cannot fetch a URL and emit a PDF; it can only consume one.
        Dim document As New PDFDocument()
        document.Load("input.pdf")
        Console.WriteLine($"Loaded {document.PageCount} page(s) for view/print.")
        document.Close()
    End Sub
End Class
$vbLabelText   $csharpLabel

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");
    }
}
// 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");
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        Dim renderer = New ChromePdfRenderer()
        Dim pdf = renderer.RenderUrlAsPdf("https://example.com")
        pdf.SaveAs("output.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

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();
    }
}
// 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();
    }
}
Imports O2S.Components.PDFView4NET
Imports System

Class Program
    Shared Sub Main()
        ' The HTML string cannot be rendered by PDFView4NET. Assume an upstream
        ' tool produced "document.pdf"; PDFView4NET can then display or print it.
        Dim document As New PDFDocument()
        document.Load("document.pdf")
        Console.WriteLine($"Document ready for viewing — {document.PageCount} page(s).")
        document.Close()
    End Sub
End Class
$vbLabelText   $csharpLabel

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");
    }
}
// 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");
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        Dim htmlContent As String = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>"
        Dim renderer = New ChromePdfRenderer()
        Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
        pdf.SaveAs("document.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

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();
        }
    }
}
// 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();
        }
    }
}
Imports O2S.Components.PDFView4NET
Imports System
Imports System.IO

Class Program
    Shared Sub Main()
        Using fs As FileStream = File.OpenRead("document.pdf")
            Dim document As New PDFDocument()
            document.Load(fs)
            Dim text As String = ""
            For i As Integer = 0 To document.PageCount - 1
                text &= document.Pages(i).ExtractText()
            Next
            Console.WriteLine(text)
            document.Close()
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel

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);
    }
}
// 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);
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        Dim pdf = PdfDocument.FromFile("document.pdf")
        Dim text As String = pdf.ExtractAllText()
        Console.WriteLine(text)
    End Sub
End Class
$vbLabelText   $csharpLabel

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");
// IronPDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
// or: renderer.RenderUrlAsPdf(url);
pdf.SaveAs("output.pdf");
Imports IronPdf

Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
' or: renderer.RenderUrlAsPdf(url)
pdf.SaveAs("output.pdf")
$vbLabelText   $csharpLabel

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");
// 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");
' PDFView4NET: instantiate then Load(path) or Load(stream)
Dim document As New PDFDocument()
document.Load("document.pdf")

' IronPDF: Direct file path
Dim pdf = PdfDocument.FromFile("document.pdf")
$vbLabelText   $csharpLabel

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);
// 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);
Imports PDFView4NET
Imports IronPDF

' PDFView4NET: document.PageCount and document.Pages(i)
For i As Integer = 0 To document.PageCount - 1
    document.Pages(i).ExtractText()
Next

' IronPDF: pdf.PageCount and Pages(i) or ExtractAllText()
Dim text As String = pdf.ExtractAllText()
' Or per-page: pdf.ExtractTextFromPage(0)
$vbLabelText   $csharpLabel

Save Method Change

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

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");
var pdf1 = PdfDocument.FromFile("chapter1.pdf");
var pdf2 = PdfDocument.FromFile("chapter2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("complete_book.pdf");
Dim pdf1 = PdfDocument.FromFile("chapter1.pdf")
Dim pdf2 = PdfDocument.FromFile("chapter2.pdf")
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("complete_book.pdf")
$vbLabelText   $csharpLabel

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");
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");
Dim 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")
$vbLabelText   $csharpLabel

Password Protection

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

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");
var pdf = PdfDocument.FromFile("form.pdf");
pdf.Form.FindFormField("FirstName").Value = "John";
pdf.Form.FindFormField("LastName").Value = "Doe";
pdf.SaveAs("filled_form.pdf");
Dim pdf = PdfDocument.FromFile("form.pdf")
pdf.Form.FindFormField("FirstName").Value = "John"
pdf.Form.FindFormField("LastName").Value = "Doe"
pdf.SaveAs("filled_form.pdf")
$vbLabelText   $csharpLabel

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");
}
// ASP.NET Core
[HttpGet]
public IActionResult GeneratePdf()
{
    var renderer = new ChromePdfRenderer();
    var pdf = renderer.RenderHtmlAsPdf(GetReportHtml());
    return File(pdf.BinaryData, "application/pdf", "report.pdf");
}
<HttpGet>
Public Function GeneratePdf() As IActionResult
    Dim renderer As New ChromePdfRenderer()
    Dim pdf = renderer.RenderHtmlAsPdf(GetReportHtml())
    Return File(pdf.BinaryData, "application/pdf", "report.pdf")
End Function
$vbLabelText   $csharpLabel

Feature Comparison Summary

Feature PDFView4NET IronPDF
View PDFs Yes (UI) No (use viewer)
Load PDFs Yes Yes
Save PDFs Limited Yes
HTML to PDF No Yes
URL to PDF No Yes
Merge PDFs No Yes
Split PDFs Limited Yes
Watermarks No Yes
Headers/Footers No Yes
Password Protection No Yes
Digital Signatures No Yes
Text Extraction Limited Yes
Fill Forms Limited Yes
WinForms Yes Yes
WPF Yes Yes
Console Limited Yes
ASP.NET No Yes
Azure No Yes
Docker No Yes

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 notePDFView4NET 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

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me