Skip to footer content
PRODUCT COMPARISONS

A Comparison between IronPDF and PDFNet

1. Introduction

Looking for the perfect PDF tools for the .NET Framework?

In this article, we will take a look at how to work with PDF files in C# (one of the most popular programming languages). We will discuss two industry-leading PDF tools for C# on the .NET Framework, using code samples to compare them based on their performance and features. In the end, we will examine their licensing details and learn how to obtain license keys.

The two PDF libraries are:

  • PDFNet
  • IronPDF

2. IronPDF

IronPDF is a C# .NET library developed by Iron Software to solve all PDF problems for C# .NET developers using a single library. IronPDF is powered by a Chromium engine and has a variety of helpful and powerful capabilities such as the conversion of HTML5, JavaScript, CSS, and image files to PDF, creating custom headers and footers, and displaying PDFs precisely as they appear in a browser. IronPDF allows you to read data from PDF files and insert it into your .NET applications and data storage systems automatically. You can import, move, and index content from old PDF document storage into your document management and business applications.

2.1. IronPDF Features

2.1.1. PDF Conversions

This functionality allows you to generate PDF files from various formats such as HTML, MVC views, Web Forms, HTML Strings, and URLs.

2.1.2. Extraction of PDF Content

In many circumstances, you can easily extract embedded text from PDFs. However, if that fails, your text is most likely embedded in an image. To scan documents for visual text, rather than plain text, use the IronOCR library.

Headers and footers can be added while creating a PDF or to existing PDFs. Using the Print Options property, you may create a header and footer for each document page. These parameters are available on the ChromePdfRenderer object. This example runs within a .NET Core console app.

2.1.4. PDF Image Processing

This enables users to generate images from PDFs as well as PDFs from photographs. It supports image extraction, various image extensions, and PDF printing.

2.1.5. PDF Documents IO

IronPDF also includes 128-bit PDF encryption, password-protected PDF locking, and the digital signing of PDFs.

2.1.6. PDF Editing

IronPDF tool allows you to add watermarks, add pages, remove pages, backgrounds, foregrounds, and much more to your PDFs.

2.1.7. Compatibility

IronPDF supports almost all operating systems and frameworks compatible with C#, such as:

  • Windows
  • .NET Core 2.1, 3.0, 3.1, .NET 6 & 5
  • .NET Standard 2.0 Compliance for Universal Compatibility
  • Azure
  • AWS
  • Docker
  • Linux

3. PDFNet

PDFNet .NET SDK by PDFTron brings precise PDF processing, annotation, editing, and creation to any framework or application on the web, mobile, desktop, or server. It manages the entire document and information management process with your infrastructure and eliminates the need for third-party server dependencies. PDFTron's web platform comes with a JS version with the supported platform and a demo license key for all the PDF SDKs.

One of the most significant benefits of PDFNet is that it is genuinely cross-platform, allowing our users to simply add PDF compatibility and relevant business functionality to their workflows and apps across many distinct mobile and desktop contexts, all while using virtually the same interface.

3.1. PDFNet SDK Features

3.1.1. Compatibility

The PDFNet SDK is compatible with many platforms and frameworks. To ensure platform consistency, the JavaScript API is utilized in the same way as the PDFNet API. Node.js and Electron versions of the SDK are also available. This package requires unmanaged add-on binaries.

3.1.2. Editing and Viewing

Brings safe, scalable, and high-fidelity reading and editing abilities for PDFs to users across online, mobile, and desktop platforms.

3.1.3. Signing

Create customized signing procedures. Digitally signed papers can be certified, validated, and sealed.

3.1.4. True Redaction

Remove sensitive data from documents, such as personal information or personal health information, while leaving the document searchable.

3.1.5. Manipulation of the Page

Pages can be added, removed, or rearranged. Documents may be assembled, merged, or divided into parts. View several documents simultaneously in the same reader or beside each other.

4. Creating a New Project in Visual Studio

In this article, we are going to use a console application to generate PDF documents.

Open the Visual Studio software and go to the File menu. Select "new project" and then select console application.

Enter the project name and select the path in the appropriate text box. Then, click the create button. Select the required .NET framework, as in the screenshot below:

A Comparison Between IronPDF and PDFNet, Figure 1

The Visual Studio project will now generate the structure for the console application. Once finished, it will open the Program.cs file, in which you can write and execute source code.

A Comparison Between IronPDF and PDFNet, Figure 2

Now we can add the library and test the program.

5. Install the IronPDF Library

The IronPDF library can be downloaded and installed in four different ways. These are:

5.1 Using the Visual Studio NuGet Package Manager

The Visual Studio software provides the NuGet Package Manager option to install the package directly to the solution. The below screenshot shows how to open the NuGet Package Manager.

A Comparison Between IronPDF and PDFNet, Figure 3

With the Package Manager GUI open, click on the Browse tab and search for "IronPDF:"

A Comparison Between IronPDF and PDFNet, Figure 4

In the above image, we can see the list of related packages from the search. Select the IronPDF option and install the package to our solution.

5.2 Using the Visual Studio Command-Line

  • In the Visual Studio menu, Go to Tools > NuGet Package manager > Package manager console
A Comparison Between IronPDF and PDFNet, Figure 5

  • Enter the following line in the package manager console tab:
Install-Package IronPdf

The IronPDF package will now be installed in the project.

A Comparison Between IronPDF and PDFNet, Figure 6

5.3 Direct Download from the NuGet Webpage

The third way is to download the NuGet package directly from the NuGet Gallery IronPDF Package.

  • Select the download package option from the menu on the right-hand side.
  • Double-click the downloaded package; it will be installed automatically.
  • Next, reload the solution and begin using it in the project.

5.4 Direct Download from the IronPDF Webpage

Download the latest package directly from the IronPDF Download Page. After the download, follow the steps below to add the package to the project.

  • Right-click the project from the solution window.
  • Then, select the options reference and browse the location of the downloaded reference.
  • Next, click OK to add the reference.

6. Install the PDFNet SDK

The PDFNet SDK can be downloaded and installed in four different ways.

  • Using the Visual Studio NuGet Package Manager.
  • Using the Visual Studio Command Line.
  • Direct Download from the NuGet Gallery PDFNet Package.
  • Using PDFNetLoader.dll

6.1. Using the Visual Studio NuGet Package Manager

As explained above, go to tools in Visual Studio and open the NuGet package manager. A list will appear — click on manage NuGet package for solutions.

A Comparison Between IronPDF and PDFNet, Figure 7

A window will appear with a search bar. Search for PDFNet and install it in the project.

6.2. Using the Visual Studio Command Line

  • In the Visual Studio menu, Go to Tools > NuGet Package manager > Package manager console
  • Enter the following line in the package manager console tab:
Install-Package PDFNet -Version 9.2.0
A Comparison Between IronPDF and PDFNet, Figure 8

6.3. Direct Download from the NuGet Webpage

The third way is to download the NuGet package directly from the NuGet Gallery PDFNet Package.

  • Choose the download package choice from the right-hand menu.
  • Double-click the downloaded package to start the installation process.

6.4. Using PDFNetLoader.dll

You can also install the PDFNet API using the PDFNetLoader.dll file. Download it from GitHub Releases for PDFNetLoader.dll.

Download the package, place it in the bin file of the project, and run it. In your Visual Studio project, add PDFNetLoader.dll as a reference.

7. Printing a PDF File (Code Samples)

Printing a PDF file is a must-have feature for modern applications that deal with PDFs. Here, we will discuss how to print PDF files using both tools.

7.1. Printing a PDF file Using IronPDF

IronPDF prints a PDF by sending it to the computer's default printer. This will open the Windows print interface — just click print to make it happen.

using IronPdf;

class PrintPDF
{
    static void Main(string[] args)
    {
        // Create a new PDF and print it
        var Renderer = new IronPdf.ChromePdfRenderer();
        PdfDocument Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

        // Send the PDF to the default printer to print
        Pdf.Print(300, false);
    }
}
using IronPdf;

class PrintPDF
{
    static void Main(string[] args)
    {
        // Create a new PDF and print it
        var Renderer = new IronPdf.ChromePdfRenderer();
        PdfDocument Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

        // Send the PDF to the default printer to print
        Pdf.Print(300, false);
    }
}
Imports IronPdf

Friend Class PrintPDF
	Shared Sub Main(ByVal args() As String)
		' Create a new PDF and print it
		Dim Renderer = New IronPdf.ChromePdfRenderer()
		Dim Pdf As PdfDocument = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")

		' Send the PDF to the default printer to print
		Pdf.Print(300, False)
	End Sub
End Class
$vbLabelText   $csharpLabel

7.2. Printing a PDF File Using PDFNet

PDFTron's PDFNet SDK also provides a printing feature. Below is the source code snippet for printing a PDF file in PDFNet.

using System;
using pdftron;
using pdftron.PDF;
using pdftron.Common;
using pdftron.Filters;

namespace PDFPrintTestCS
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Opening the input file...");
            using (PDFDoc pdfdoc = new PDFDoc("tiger.pdf"))
            {
                pdfdoc.InitSecurityHandler();
                Console.WriteLine("Printing the input file using PDF.Print.StartPrintJob...");
                PrinterMode printerMode = new PrinterMode();
                printerMode.SetAutoCenter(true);
                printerMode.SetAutoRotate(true);
                printerMode.SetCollation(true);
                printerMode.SetCopyCount(1);
                printerMode.SetDPI(300); // Set print quality to 300 DPI
                printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);
                printerMode.SetNUp(PrinterMode.NUp.e_NUp_1_1, PrinterMode.NUpPageOrder.e_PageOrder_LeftToRightThenTopToBottom);
                printerMode.SetOrientation(PrinterMode.Orientation.e_Orientation_Portrait);
                printerMode.SetOutputAnnot(PrinterMode.PrintContentTypes.e_PrintContent_DocumentAndAnnotations);
                printerMode.SetOutputColor(PrinterMode.OutputColor.e_OutputColor_Grayscale);
                printerMode.SetOutputPageBorder(false);
                printerMode.SetOutputQuality(PrinterMode.OutputQuality.e_OutputQuality_Medium);
                printerMode.SetPaperSize(new Rect(0, 0, 612, 792));
                PageSet pagesToPrint = new PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all);
                Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", pagesToPrint, printerMode, null);
            }
        }
    }
}
using System;
using pdftron;
using pdftron.PDF;
using pdftron.Common;
using pdftron.Filters;

namespace PDFPrintTestCS
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Opening the input file...");
            using (PDFDoc pdfdoc = new PDFDoc("tiger.pdf"))
            {
                pdfdoc.InitSecurityHandler();
                Console.WriteLine("Printing the input file using PDF.Print.StartPrintJob...");
                PrinterMode printerMode = new PrinterMode();
                printerMode.SetAutoCenter(true);
                printerMode.SetAutoRotate(true);
                printerMode.SetCollation(true);
                printerMode.SetCopyCount(1);
                printerMode.SetDPI(300); // Set print quality to 300 DPI
                printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto);
                printerMode.SetNUp(PrinterMode.NUp.e_NUp_1_1, PrinterMode.NUpPageOrder.e_PageOrder_LeftToRightThenTopToBottom);
                printerMode.SetOrientation(PrinterMode.Orientation.e_Orientation_Portrait);
                printerMode.SetOutputAnnot(PrinterMode.PrintContentTypes.e_PrintContent_DocumentAndAnnotations);
                printerMode.SetOutputColor(PrinterMode.OutputColor.e_OutputColor_Grayscale);
                printerMode.SetOutputPageBorder(false);
                printerMode.SetOutputQuality(PrinterMode.OutputQuality.e_OutputQuality_Medium);
                printerMode.SetPaperSize(new Rect(0, 0, 612, 792));
                PageSet pagesToPrint = new PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all);
                Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", pagesToPrint, printerMode, null);
            }
        }
    }
}
Imports System
Imports pdftron
Imports pdftron.PDF
Imports pdftron.Common
Imports pdftron.Filters

Namespace PDFPrintTestCS
	Friend Class Program
		Shared Sub Main(ByVal args() As String)
			Console.WriteLine("Opening the input file...")
			Using pdfdoc As New PDFDoc("tiger.pdf")
				pdfdoc.InitSecurityHandler()
				Console.WriteLine("Printing the input file using PDF.Print.StartPrintJob...")
				Dim printerMode As New PrinterMode()
				printerMode.SetAutoCenter(True)
				printerMode.SetAutoRotate(True)
				printerMode.SetCollation(True)
				printerMode.SetCopyCount(1)
				printerMode.SetDPI(300) ' Set print quality to 300 DPI
				printerMode.SetDuplexing(PrinterMode.DuplexMode.e_Duplex_Auto)
				printerMode.SetNUp(PrinterMode.NUp.e_NUp_1_1, PrinterMode.NUpPageOrder.e_PageOrder_LeftToRightThenTopToBottom)
				printerMode.SetOrientation(PrinterMode.Orientation.e_Orientation_Portrait)
				printerMode.SetOutputAnnot(PrinterMode.PrintContentTypes.e_PrintContent_DocumentAndAnnotations)
				printerMode.SetOutputColor(PrinterMode.OutputColor.e_OutputColor_Grayscale)
				printerMode.SetOutputPageBorder(False)
				printerMode.SetOutputQuality(PrinterMode.OutputQuality.e_OutputQuality_Medium)
				printerMode.SetPaperSize(New Rect(0, 0, 612, 792))
				Dim pagesToPrint As New PageSet(1, pdfdoc.GetPageCount(), PageSet.Filter.e_all)
				Print.StartPrintJob(pdfdoc, "", pdfdoc.GetFileName(), "", pagesToPrint, printerMode, Nothing)
			End Using
		End Sub
	End Class
End Namespace
$vbLabelText   $csharpLabel

8. Make PDFs from HTML

Both libraries possess HTML to PDF conversion capabilities, but the methods are slightly different.

8.1. Make PDFs from HTML Using IronPDF

IronPDF does not require the use of JSON or encryption mechanisms. IronPDF supports a wide range of methods. For example:

HTML Files to PDF

using IronPdf;

class HtmlToPdf
{
    static void Main(string[] args)
    {
        var Renderer = new IronPdf.ChromePdfRenderer();
        Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf");
    }
}
using IronPdf;

class HtmlToPdf
{
    static void Main(string[] args)
    {
        var Renderer = new IronPdf.ChromePdfRenderer();
        Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf");
    }
}
Imports IronPdf

Friend Class HtmlToPdf
	Shared Sub Main(ByVal args() As String)
		Dim Renderer = New IronPdf.ChromePdfRenderer()
		Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>").SaveAs("pixel-perfect.pdf")
	End Sub
End Class
$vbLabelText   $csharpLabel

URL to PDF

using IronPdf;

class UrlToPdf
{
    static void Main(string[] args)
    {
        IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
        var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
        Pdf.SaveAs("url.pdf");
    }
}
using IronPdf;

class UrlToPdf
{
    static void Main(string[] args)
    {
        IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
        var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
        Pdf.SaveAs("url.pdf");
    }
}
Imports IronPdf

Friend Class UrlToPdf
	Shared Sub Main(ByVal args() As String)
		Dim Renderer As New IronPdf.ChromePdfRenderer()
		Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")
		Pdf.SaveAs("url.pdf")
	End Sub
End Class
$vbLabelText   $csharpLabel
A Comparison Between IronPDF and PDFNet, Figure 9

8.2. Make PDFs from HTML Using PDFNet

PDFNet also provides HTML-to-PDF conversion features using both page conversion and URL conversion. Due to the lengthy code, we will only give you one example here.

class HTML2PDFSample
{
    private static pdftron.PDFNetLoader pdfNetLoader = pdftron.PDFNetLoader.Instance();
    static HTML2PDFSample() {}

    static void Main(string[] args)
    {
        string output_path = "../../../../TestFiles/Output/html2pdf_example";
        string host = "https://www.pdftron.com";
        HTML2PDF.SetModulePath("../../../../../Lib");

        if (!HTML2PDF.IsModuleAvailable())
        {
            Console.WriteLine();
            Console.WriteLine("Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.");
            return;
        }

        try
        {
            using (PDFDoc doc = new PDFDoc())
            {
                if (HTML2PDF.Convert(doc, host + "/"))
                    doc.Save(output_path + "_01.pdf", SDFDoc.SaveOptions.e_linearized);
                else
                    Console.WriteLine("Conversion failed.");
            }
        }
        catch (PDFNetException e)
        {
            Console.WriteLine(e.Message);
        }
    }
}
class HTML2PDFSample
{
    private static pdftron.PDFNetLoader pdfNetLoader = pdftron.PDFNetLoader.Instance();
    static HTML2PDFSample() {}

    static void Main(string[] args)
    {
        string output_path = "../../../../TestFiles/Output/html2pdf_example";
        string host = "https://www.pdftron.com";
        HTML2PDF.SetModulePath("../../../../../Lib");

        if (!HTML2PDF.IsModuleAvailable())
        {
            Console.WriteLine();
            Console.WriteLine("Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.");
            return;
        }

        try
        {
            using (PDFDoc doc = new PDFDoc())
            {
                if (HTML2PDF.Convert(doc, host + "/"))
                    doc.Save(output_path + "_01.pdf", SDFDoc.SaveOptions.e_linearized);
                else
                    Console.WriteLine("Conversion failed.");
            }
        }
        catch (PDFNetException e)
        {
            Console.WriteLine(e.Message);
        }
    }
}
Friend Class HTML2PDFSample
	Private Shared pdfNetLoader As pdftron.PDFNetLoader = pdftron.PDFNetLoader.Instance()
	Shared Sub New()
	End Sub

	Shared Sub Main(ByVal args() As String)
		Dim output_path As String = "../../../../TestFiles/Output/html2pdf_example"
		Dim host As String = "https://www.pdftron.com"
		HTML2PDF.SetModulePath("../../../../../Lib")

		If Not HTML2PDF.IsModuleAvailable() Then
			Console.WriteLine()
			Console.WriteLine("Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.")
			Return
		End If

		Try
			Using doc As New PDFDoc()
				If HTML2PDF.Convert(doc, host & "/") Then
					doc.Save(output_path & "_01.pdf", SDFDoc.SaveOptions.e_linearized)
				Else
					Console.WriteLine("Conversion failed.")
				End If
			End Using
		Catch e As PDFNetException
			Console.WriteLine(e.Message)
		End Try
	End Sub
End Class
$vbLabelText   $csharpLabel
A Comparison Between IronPDF and PDFNet, Figure 10

9. Licensing

IronPDF is a library that offers a free developer license. IronPDF also offers a special price structure: the light package begins at $749 with no hidden costs. It is also possible to redistribute SaaS and OEM products. All licenses include a 30-day money-back guarantee, a year of software support and upgrades, development/testing/staging/production validity, and a perpetual license (one-time purchase). IronPDF licenses provide maximal performance for users' needs. Go to this IronPDF Licensing Page to see IronPDF's whole pricing structure and license.

A Comparison Between IronPDF and PDFNet, Figure 11

The PDFTron PDFNet SDK comes with several license choices that are tailored to your business needs. Three types of licenses come with enterprise and OEM redistributions. Enterprise licenses are only for organization use and cannot be used in app distribution. Additional APIs requiring filesystem access are also included with the licenses. All licenses come with a license key. The three types of licenses are:

  • Viewer
  • Viewer & Annotation
  • Core SDK

For further information on their license structures, visit this PDFTron Licensing Information Page.

10. Conclusion

IronPDF offers a lot of features and functionality for processing PDF files and converting them to different formats. Conversions from HTML to PDF are produced in a vector format that is appropriate for high-quality commercial printing. As a result, you'll receive a clear, high-quality PDF. License and pricing information can be found on the website.

Similar to IronPDF, PDFNet aids with the transition, annotation, signature, filling, conversion, and editing of PDF files. It supports multiple platforms, including Windows, iOS, Android, WEB, and Linux. For production use, PDFNet SDKs need a product key.

IronPDF's licenses are developer-centric, meaning that you have to get a license based on how many developers are going to use the product. On the other hand, PDFNet licenses don't work in the same manner, operating instead on a feature-based license. This means that you have to get the license that supports the features that are required. IronPDF licenses include all features out of the box. With PDFNet, some features, such as document conversion, need to be bought as add-ons.

The IronPDF library offers features in an organized manner, making it easy to write code that performs big tasks using a few lines of code. Iron Software is currently offering a five-tool package for the price of just two. The tools included in the Iron Suite are:

Please visit this Iron Suite Information Page to Explore Iron Suite.

Please notePDFTron is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by PDFTron. 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.

Frequently Asked Questions

What are the key PDF libraries compared in the article?

The article compares IronPDF, developed by Iron Software, and PDFNet by PDFTron, focusing on their capabilities for C# developers within the .NET Framework.

How can I convert HTML to PDF in C#?

You can use IronPDF's RenderHtmlAsPdf method to convert HTML strings into PDFs. Additionally, you can convert HTML files and URLs to PDFs using IronPDF's robust Chromium engine.

What operating systems are supported by IronPDF?

IronPDF supports multiple operating systems, including Windows, Azure, and Docker, allowing seamless integration into diverse development environments.

How does IronPDF handle PDF data extraction?

IronPDF allows for efficient PDF data extraction, enabling developers to easily retrieve text and images from PDF documents for further processing.

What are the installation options for IronPDF?

IronPDF can be installed via the Visual Studio NuGet Package Manager, the Visual Studio Command Line, or directly from the NuGet Gallery, ensuring easy setup for developers.

What are the licensing differences between IronPDF and PDFNet?

IronPDF offers developer-centric licenses that include all features, while PDFNet licenses are feature-based and may require additional purchases for specific functionalities.

Is IronPDF suitable for large PDF tasks?

Yes, IronPDF is praised for its ease of use and minimal code requirements, making it suitable for handling large PDF tasks efficiently.

What additional tools are included in the Iron Software suite?

The Iron Software suite includes IronBarcode, IronXL, IronOCR, IronPDF, and IronWebscraper, available as a package deal, enhancing its appeal to developers.

Chipego
Software Engineer
Chipego has a natural skill for listening that helps him to comprehend customer issues, and offer intelligent solutions. He joined the Iron Software team in 2023, after studying a Bachelor of Science in Information Technology. IronPDF and IronOCR are the two products Chipego has been focusing on, but his knowledge of ...Read More