A Comparison between IronPDF and NReco .NET Core

Introduction

PDF files are used in a variety of industries for invoicing and document generation. When generating documents, developers use the PDF format to fulfill their client's requirements. With the libraries on the market today, creating PDFs has never been easier. When using this type of library in a project, we must evaluate factors such as building, reading, and converting to determine which library is the best on the market.

In this article, we will compare the two most popular PDF libraries for .NET components. These two libraries are:

  • IronPDF
  • NReco

IronPDF and NReco are two libraries that can be used to create, read, update and manipulate PDF files in your .NET application, whether it be it a desktop, a web or a mobile application. We will first compare the two libraries' features, then we'll look at their performance in converting and manipulating PDF files. Microsoft's .NET frameworks support both libraries.

The next question is to decide which C# PDF Library is best suited to your .NET project. You can weigh up your decision as you read the following comparison between the two libraries.

Let's first have a look at what both libraries have to offer, and then move on to the comparison itself.

IronPDF Features

The IronPDF .NET PDF library solution is a dream for developers, especially C# software engineers. You can easily create a .NET Core PDF processing application with this excellent tool.

IronPDF uses a .NET Chromium engine to render HTML pages to PDF files. There is no need to use complex APIs to render or manipulate PDFs. IronPDF supports standard web technologies: HTML, ASPX, JS, CSS, and images.

It also enables you to create a .NET PDF library using HTML5, CSS, JavaScript, and images. You can effortlessly edit, watermark, and add headers and footers to a PDF. Furthermore, it makes it very easy to read PDF text and extract images.

Some of the important features include:

Create PDFs (HTML-to-PDF)

  • Create PDF documents from HTML 4 and 5, CSS, and JavaScript
  • Generate PDF documents from URL
  • Generate PDF from ASP.NET applications (Razor, MVC View):
  • Load URLs with custom network login credentials, User-Agents, Proxies, Cookies, HTTP headers, and form variables, allowing login behind HTML forms

Edit existing PDF Documents without Adobe Acrobat

  • Read and fill form fields data
  • Extract images and texts from PDF
  • Add new HTML content into an existing PDF page
  • Add logical or HTML headers and footers

Manipulate existing PDF Documents

  • Load and parse existing PDF documents
  • Merge and split the content into PDF documents
  • Add headers, footers, annotations, bookmarks, watermarks, text, and image assets

Convert from Multiple Formats

  • ASPX WebForms — convert ASP.NET webforms to downloadable PDFs viewable in the browser in three lines of code
  • HTML Document — Convert HTML to PDF
  • Custom 'Base URL' to allow accessible asset files across the web
  • Responsive layouts through Virtual Viewport (width and height)
  • Accept HTML encoded in any major file encoding (Default to UTF-8)

Save and Print

  • Save and load from file, binary data, or MemoryStreams
  • Supports Screen and Print-based CSS media types
  • Turn PDF files into a PrintDocument object and print without Adobe (with minimal code)
  • Export official log files with details about API success and debug errors in source code.

NReco

NReco provides a library for .NET and .NET Core for HTML-to-PDF conversion. It can generate PDF documents from HTML templates or from web page URLs.

In most cases (99% of the time), PDFs generated from NReco looks very similar it would appear as a web page displayed in a web browser. The engine supports page headers/footers, page numbering, custom fonts, and JavaScript execution.

The NReco library is based on the WkHtmlToPdf command line tool, which uses the WebKit engine to render HTML content as PDFs. The library makes use of wkhtmltoPdf binaries (win-x86) during execution. There is not need to install these manually. The NReco library extracts and executes the wkHtmlToPdf binaries automatically during runtime for convenience.

  • Some of the core features include:
    • Create PDF from HTML string, file, or URL
    • Convert ASPX pages and MVC views to PDFs
    • Merge several HTML pages into one, generated PDF
  • PDF options:
    • Page orientation, custom page size, page margins
    • HTML templates for page header/footer, page numbering, cover page, etc
    • Automatic table of contents generation based on web page headings (H1/H2/H3)

Creating a New Project in Visual Studio:

We will create a new project in Visual Studio to demonstrate how these two libraries carry out PDF generation.

Open Visual Studio. Click on Create New Project => Select Template (Console Application) => Click on Next => Name the Project => Select .NET Framework Version => Click on Create Button.

Comparing IronPDF and NReco, Figure 1: New Visual Studio C# Console Application

A new project will be created.

Let's install both libraries one by one.

IronPDF C# Library Installation

There are four ways to download and install the IronPDF library. These are as follows:

  1. Using Visual Studio NuGet Package Manager.
  2. Using Package Manager Console.
  3. Download the NuGet Package directly from the NuGet Web page.
  4. Download the IronPDF .DLL Library from the IronPDF Web page.

Let’s take a closer look at each one.

Install Using NuGet Package Manager:

Follow the following steps to download IronPDF from NuGet Package Manager.

From the menu bar, click on Tools > NuGet Package Manager > Manage NuGet Package for Solutions.

A new window will appear. Click on Browse => Search for IronPDF=> click on the Install button, as shown below.

Comparing IronPDF and NReco, Figure 2: Installing IronPDF using the NuGet Package Manager GUI

This will install IronPDF Library in our project.

Using the Package Manager Console

In Visual Studio, go to Tools > NuGet Package manager > Package Manager console

Enter the following line in the package manager console tab:

Install-Package IronPdf

Direct download from the NuGet website

The third way is to download the NuGet package directly from the website.

  • Navigate to the link
  • Select the download package option from the menu on the right-hand side
  • Double-click the downloaded package. It will be installed automatically
  • Now reload the solution and begin using it in the project.

Direct download from the IronPDF website

Click this link to download the latest package directly from the website. After downloading, follow the steps below to add the package to the project.

  • Right-click the project from the solution window.
  • Select option reference and then navigate to the location of the downloaded reference.

Next, click OK to add the reference.

Install the NReco library

The NReco library can be downloaded by using one of the following four ways.

  • Using Visual Studio NuGet Package Manager Solution
  • Using the Package Manager Console.
  • Direct download from the NuGet website.
  • Direct download from the NReco website.

Using Visual Studio

As above, just go to the NuGet package manager and search for the keyword "NReco".

Using the Visual Studio Command-Line

In Visual Studio, go to Tools > NuGet Package Manager > Package manager console

Enter the following line in the package manager console tab:

Install-Package NReco.PdfGenerator -Version 1.2.0

Direct download from the NuGet website

The third way is to download the NuGet package directly from the website.

  • Navigate to the link "https://www.nuget.org/packages/nreco/"
  • Click the Download Package option from the menu on the right-hand side.
  • Double-click the downloaded package. It will be installed automatically.
  • Reload the solution and begin using it in the project.

Direct download from the NReco website

Click this link to view a list of available DLLs. Download the latest package for various .NET Frameworks After downloading, follow the steps below to add the package to the project.

  • Right-click the project from the solution window.
  • Select the Options reference and navigate to the location of the downloaded package.
  • Click OK to add the reference.

Let's explore the functionalities of both libaries.

Generate PDFs

Both libraries support the generation of PDF documents, but they do so in different ways.

Generate a PDF from URL using IronPDF

ChromePdfRenderer chromePdfRenderer = new ChromePdfRenderer();
var file = chromePdfRenderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/PDF");
file.SaveAs(@"D:\urlToPdfIronPDF.pdf");
ChromePdfRenderer chromePdfRenderer = new ChromePdfRenderer();
var file = chromePdfRenderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/PDF");
file.SaveAs(@"D:\urlToPdfIronPDF.pdf");
Dim chromePdfRenderer As New ChromePdfRenderer()
Dim file = chromePdfRenderer.RenderUrlAsPdf("https://en.wikipedia.org/wiki/PDF")
file.SaveAs("D:\urlToPdfIronPDF.pdf")
VB   C#

The above code will generate a PDF from a provided URL. The output of the source code is below.

Comparing IronPDF and NReco, Figure 3: Generating a PDF from a URL using IronPDF

Generate PDF from URL using NReco

var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter(); htmlToPdf.GeneratePdfFromFile("https://en.wikipedia.org/wiki/PDF", null, @"D:\urlToPDFNreco.pdf");
var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter(); htmlToPdf.GeneratePdfFromFile("https://en.wikipedia.org/wiki/PDF", null, @"D:\urlToPDFNreco.pdf");
Dim htmlToPdf = New NReco.PdfGenerator.HtmlToPdfConverter()
htmlToPdf.GeneratePdfFromFile("https://en.wikipedia.org/wiki/PDF", Nothing, "D:\urlToPDFNreco.pdf")
VB   C#

Generating PDFs from URL using NReco requires the use of another library: NReco.PDFGenerator.LT Additionally, PDF generation requires a commercial license. Without it, the above code will throw the exception shown below:

Comparing IronPDF and NReco, Figure 4: NReco's URL-to-PDF generation feature requires ownership of a commercial license

Generate PDF from HTML String using IronPDF:

string htmlstring = "<h1> This is sample pdf generated by IronPDF</h1>";
ChromePdfRenderer chromePdfRenderer = new ChromePdfRenderer();
var file = chromePdfRenderer.RenderHtmlAsPdf(htmlstring);
file.SaveAs(@"D:\HTMLToPdfIronPDF.pdf");
string htmlstring = "<h1> This is sample pdf generated by IronPDF</h1>";
ChromePdfRenderer chromePdfRenderer = new ChromePdfRenderer();
var file = chromePdfRenderer.RenderHtmlAsPdf(htmlstring);
file.SaveAs(@"D:\HTMLToPdfIronPDF.pdf");
Dim htmlstring As String = "<h1> This is sample pdf generated by IronPDF</h1>"
Dim chromePdfRenderer As New ChromePdfRenderer()
Dim file = chromePdfRenderer.RenderHtmlAsPdf(htmlstring)
file.SaveAs("D:\HTMLToPdfIronPDF.pdf")
VB   C#

See below for output:

Comparing IronPDF and NReco, Figure 5: Results of IronPDF's HTML-to-PDF Generation Feature

Generate PDF from HTML template using NReco:

string htmlstring = "<h1> This is sample pdf generated by NReco</h1>";
var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
htmlToPdf.GeneratePdf(htmlstring,null, @"D:\HTMLToPdfIronPDF.pdf");
string htmlstring = "<h1> This is sample pdf generated by NReco</h1>";
var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
htmlToPdf.GeneratePdf(htmlstring,null, @"D:\HTMLToPdfIronPDF.pdf");
Dim htmlstring As String = "<h1> This is sample pdf generated by NReco</h1>"
Dim htmlToPdf = New NReco.PdfGenerator.HtmlToPdfConverter()
htmlToPdf.GeneratePdf(htmlstring,Nothing, "D:\HTMLToPdfIronPDF.pdf")
VB   C#

The source code above generates PDFs using the NReco C# WkHtmlToPdf wrapper.Executing this code sucessfully also a commercial license. Therefore, running this code above will throw an exception: "This feature requires commercial license."

Comparing IronPDF and NReco, Figure 6: Generating PDFs from HTML content with NReco also requires a commercial license

Reading PDF Files

Extracting text from PDFs using IronPDF:

The following sample code demonstrates the PDF Text Extractiou feature.

var pdfFile = @"D:\SamplePDF.pdf";
PdfDocument pdfDocument = PdfDocument.FromFile(pdfFile);
string ConvertedText = pdfDocument.ExtractAllText();
Console.WriteLine(ConvertedText);
var pdfFile = @"D:\SamplePDF.pdf";
PdfDocument pdfDocument = PdfDocument.FromFile(pdfFile);
string ConvertedText = pdfDocument.ExtractAllText();
Console.WriteLine(ConvertedText);
Dim pdfFile = "D:\SamplePDF.pdf"
Dim pdfDocument As PdfDocument = PdfDocument.FromFile(pdfFile)
Dim ConvertedText As String = pdfDocument.ExtractAllText()
Console.WriteLine(ConvertedText)
VB   C#

Generated output is shown below:

Comparing IronPDF and NReco, Figure 7: IronPDF PDF Text Extraction

Extracting texts from PDFs using NReco:

We need to add one more additional library, Nreco.PdfRenderer, to extract text.

 var pdfFile = @"D:\SamplePDF.pdf";
var pdfToText = new NReco.PdfRenderer.PdfToTextConverter();
string generatedText = pdfToText.GenerateText(pdfFile);
Console.WriteLine(generatedText);
 var pdfFile = @"D:\SamplePDF.pdf";
var pdfToText = new NReco.PdfRenderer.PdfToTextConverter();
string generatedText = pdfToText.GenerateText(pdfFile);
Console.WriteLine(generatedText);
Dim pdfFile = "D:\SamplePDF.pdf"
Dim pdfToText = New NReco.PdfRenderer.PdfToTextConverter()
Dim generatedText As String = pdfToText.GenerateText(pdfFile)
Console.WriteLine(generatedText)
VB   C#

Output is shown below:

Comparing IronPDF and NReco, Figure 8: Results of NReco PDF Text Extraction

The output generated by NReco is correct, but it contains an additional symbol which should not be there.

Comparison

We have discussed the core features provided by both libraries. Now, let's compare them.

NReco uses the C# wkHtmlToPdf tool in many different use cases. We don't need to install the wkHtmltoPdf separately, but we do need to install separate NuGet Packages to create and read PDF documents. Hence, this increases the complexity in manageing a project's library dependencies. On the other hand, IronPDF needs only a one-time installation. IronPDF's full set of features require no additional libraries.

IronPDF renders HTML content into PDFs accurately, both from URls and from raw HTML strings. These same features cannot be used in NReco without first obtaining a commercial license.

Both Libraries can extract text from PDF files pretty well, but NReco includes an extra, unnecessary symbol in its output.

Comparing IronPDF and NReco, Figure 9: NREco vs IronPDF (Side-by-Side Comparison)

Licensing

NReco is a web service that creates PDF files from HTML documents. It has a variety of price structures, the lowest being $75/month. You can also sign up for a free trial, but the free trial has limited features. The detailed pricing can be checked here on the NReco page.

IronPDF is a C# PDF library. It is free for development and can always be licensed for commercial deployment. Licenses are available for single-project use, individual developers, agencies, and global corporations, as well as for SAAS and OEM redistribution. All licenses include a 30-day money-back guarantee, one year of product support and updates, validity for dev/staging/production, and also a permanent license (one-time purchase). Pricing for the Lite package starts from $749.

Summary

IronPDF does not render HTML to PDF from a remote server. Rather, it spins up an instance of a real, standards-compliant web browser behind the scenes (no additional software needs to be installed manually). The HTML is rendered with complete accuracy — and in a vector format suitable for the highest standards of commercial printing. The output is a clean and high-quality PDF. It is openly commercial, with licensing and pricing details all published on the website.

NReco also converts HTML to PDF and runs on cloud servers at multiple locations. NReco provides libraries for .NET and .NET Core with the fastest and most accurate HTML-to-PDF conversion. NReco can generate PDF files from HTML content (source code, template files, or URLs) by HTML template or web page URL. Web pages are rendered using a Qt WebKit engine, and the resulting output is nearly identical to web browser renderings.

Conclusion

After a comprehensive comparison, it can be seen that IronPDF enjoys significant advantages over NReco. IronPDF provides a comprehensive coverage for many PDF-processsing needs. When purchasing IronPDF, you get all the conversions in one single library. It supports standard web documents: HTML, ASPX, JS, CSS, and images.

NReco is a web service that creates PDF files from HTML formats. It comes with a variety of price structures, the lowest being $75/month. IronPDF, on the other hand, is free for development and can always be licensed for commercial deployment. Licenses are available for single-project use, single developers, agencies, and global corporations. All licenses include a 30-day money-back guarantee and one year of product support and updates. The Lite package starts from $749. IronPDF packages are permanent and there are no ongoing costs.

If you purchase the complete IronSuite, you will be eligible to receive all five products for the price of just two. For more details, please click here.

In closing, we choose IronPDF because of its high-performance and the large feature set. IronPDF also provides good support and documentation, which ensures that users can make full and effective use of the impressive array of features on offer.