Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
When you're working with PDFs, you'll want to use the best tool that fits your project needs, right? But with so many different PDF libraries out there, it can be hard to decide on which one is best for you. Today we will be taking a closer look at two prominent PDF libraries; IronPDF and NReco.PdfGenerator.
We will compare their features, compatibility, and overall performance to help you make an informed decision on which library might be the right fit for you.
IronPDF is a comprehensive .NET library that excels in converting HTML to PDF and an extensive set of features for working with PDF files. IronPDF supports modern web standards, including HTML5, CSS3, and JavaScript, ensuring high-fidelity PDF generation, it is also designed to be user-friendly, offering an intuitive API that integrates seamlessly with .NET applications.
NReco.PdfGenerator for .NET is a powerful library focused on HTML to PDF conversion. Its based on the WkHtmlToPdf command line tool, and relies on the Qt WebKit rendering engine to create PDF documents from HTML content. This library is known for its ease of use and quick integration into .NET projects, requiring just one .NET assembly that already includes the WkHtmlToPdf binaries. This makes it a popular choice for developers needing reliable PDF generation capabilities.
IronPDF stands out with its extensive cross-platform compatibility. It supports a wide range of environments within the .NET framework, ensuring seamless operation across different platforms. Below is a summary of IronPDF's platform compatibility:
.NET versions:
Fully written in and supports C#, VB.NET, and F#
.NET Core (8, 7, 6, 5, and 3.1+)
.NET Standard 2.0+
App environments: IronPDF works within various app environments such as Windows, Linux, Mac, Docker, Azure, and AWS.
IDEs: Works with IDEs such as Microsoft Visual Studio and JetBrains Rider & ReSharper
For more details on IronPDF's compatibility, visit IronPDF Compatibility.
.NET versions:
.NET Standard 2.0+
.NET Framework 4.5+
PDF conversion: IronPDF can convert HTML to PDF, with its full support for modern web standards, you can be assured that IronPDF will consistently return pixel-perfect PDFs from your HTML content. IronPDF can also convert PDF files from other formats such as DOCX, images, RTF, and more.
PDF Generation: With IronPDF, you can generate PDF files from URLs, ASPX files, or HTML strings.
Security features: With IronPDF, you can always be assured that any sensitive PDF files are secure thanks to its security features. Use IronPDF to encrypt your PDF files, set passwords, and set permissions for your PDF files.
PDF editing features: Using IronPDF, you can process existing PDF documents, edit them, and read PDF files with ease. IronPDF offers editing features such as adding headers and footers, stamping text and images onto the PDF pages, adding custom watermarks to the PDF, working with PDF forms, and splitting or merging PDF files.
For a comprehensive list of IronPDF features, visit IronPDF Features.
HTML to PDF Conversion: Converts HTML, CSS, and JavaScript to PDF using WkHtmlToPdf and the QT WebKit engine.
PDF Options: Supports various PDF options like page orientation, size, margins, and zoom.
Templates: HTML templates for headers, footers, and page numbering.
Content Merging: Merge multiple HTML pages into a single PDF.
Output Customization: Customize the appearance of PDFs with custom fonts and styles.
Now, let's take a closer look at some common use cases when working with PDF documents, and how these two libraries handle them.
IronPDF Example:
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from a HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
// An optional BasePath 'c:\site\assets\' is set as the file location to load assets from
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"c:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from a HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
// An optional BasePath 'c:\site\assets\' is set as the file location to load assets from
var myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"c:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
Imports IronPdf
' Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = True
' Instantiate Renderer
Dim renderer = New ChromePdfRenderer()
' Create a PDF from a HTML string using C#
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
' Export to a file or Stream
pdf.SaveAs("output.pdf")
' Advanced Example with HTML Assets
' Load external html assets: images, CSS and JavaScript.
' An optional BasePath 'c:\site\assets\' is set as the file location to load assets from
Dim myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "c:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")
NReco.PdfGenerator Example:
using system;
using NReco.PdfGenerator;
var htmlContent = String.Format("<body>Hello world: {0}</body>",
DateTime.Now);
var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
var pdfBytes = htmlToPdf.GeneratePdf(htmlContent)
using system;
using NReco.PdfGenerator;
var htmlContent = String.Format("<body>Hello world: {0}</body>",
DateTime.Now);
var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
var pdfBytes = htmlToPdf.GeneratePdf(htmlContent)
Imports system
Imports NReco.PdfGenerator
Private htmlContent = String.Format("<body>Hello world: {0}</body>", DateTime.Now)
Private htmlToPdf = New NReco.PdfGenerator.HtmlToPdfConverter()
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'var pdfBytes = htmlToPdf.GeneratePdf(htmlContent)
IronPDF provides high-fidelity rendering thanks to its support for modern web standards. When using IronPDF for HTML to PDF conversion, you will be able to create pixel perfect PDFs from HTML documents, web pages and more. NReco.PdfGenerator uses WkHtmlToPdf, which also offers reliable rendering when working with any HTML template or web page, but might not match the precision of IronPDF's rendering capabilities.
For more examples of using IronPDF for HTML to PDF conversion, visit IronPDF HTML to PDF.
IronPDF Example:
using IronPdf;
using System;
//Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
//Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
//Edit file security settings
//The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption();
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserFormData = false;
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
// change or set the document encryption password
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
using IronPdf;
using System;
//Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
//Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto";
pdf.MetaData.Keywords = "SEO, Friendly";
pdf.MetaData.ModifiedDate = DateTime.Now;
//Edit file security settings
//The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption();
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserFormData = false;
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
// change or set the document encryption password
pdf.Password = "my-password";
pdf.SaveAs("secured.pdf");
Imports IronPdf
Imports System
'Open an Encrypted File, alternatively create a new PDF from Html
Private pdf = PdfDocument.FromFile("encrypted.pdf", "password")
'Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto"
pdf.MetaData.Keywords = "SEO, Friendly"
pdf.MetaData.ModifiedDate = DateTime.Now
'Edit file security settings
'The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption()
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key")
pdf.SecuritySettings.AllowUserAnnotations = False
pdf.SecuritySettings.AllowUserCopyPasteContent = False
pdf.SecuritySettings.AllowUserFormData = False
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights
' change or set the document encryption password
pdf.Password = "my-password"
pdf.SaveAs("secured.pdf")
NReco.PdfGenerator Example: NReco.PdfGenerator does not natively support PDF encryption, as the focus of this library is primarily on handling HTML to PDF conversion.
IronPDF offers a straightforward, yet powerful, tool for encrypting PDFs. With IronPDF, you will have full control over the entire process, right down to setting security settings. NReco.PdfGenerator, however, lacks native encryption features so if you want to encrypt your PDF file after using NReco.PdfGenerator to convert it, you will need to install more libraries that can handle PDF encryption.
For more encryption examples, visit the IronPDF How-To guide for this topic.
IronPDF Example:
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'are' phrase from all pages
pdf.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
using IronPdf;
PdfDocument pdf = PdfDocument.FromFile("novel.pdf");
// Redact 'are' phrase from all pages
pdf.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
Imports IronPdf
Private pdf As PdfDocument = PdfDocument.FromFile("novel.pdf")
' Redact 'are' phrase from all pages
pdf.RedactTextOnAllPages("are")
pdf.SaveAs("redacted.pdf")
NReco.PdfGenerator Example: NReco.PdfGenerator does not natively support text redaction.
Requiring just a few lines of code, IronPDF provides you with a concise and easy-to-use redaction tool. Given how short and simple it is to implement, you can be sure that by using IronPDF's redaction feature, you will be able to raise the efficiency of your workplace right off the bat. NReco.PdfGenerator, on the other hand, would require an additional outside library to come in and handle the redaction process as it has no native support for PDF redaction.
For more redaction examples, visit the IronPDF How-To guide on this topic.
IronPDF Example:
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>foo</h1>");
// Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
// Create PdfSignature object
var sig = new PdfSignature(cert);
// Sign PDF document
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>foo</h1>");
// Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
X509Certificate2 cert = new X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable);
// Create PdfSignature object
var sig = new PdfSignature(cert);
// Sign PDF document
pdf.Sign(sig);
pdf.SaveAs("signed.pdf");
Imports IronPdf
Imports IronPdf.Signing
Imports System.Security.Cryptography.X509Certificates
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>foo</h1>")
' Create X509Certificate2 object with X509KeyStorageFlags set to Exportable
Private cert As New X509Certificate2("IronSoftware.pfx", "123456", X509KeyStorageFlags.Exportable)
' Create PdfSignature object
Private sig = New PdfSignature(cert)
' Sign PDF document
pdf.Sign(sig)
pdf.SaveAs("signed.pdf")
NReco.PdfGenerator Example: NReco.PdfGenerator does not natively support digital signatures.
IronPDF's digital signature feature provides you with an easy way of automating the way you sign PDF's. Its straightforward API gives you full control over the signing process, while its easiness to be implemented means less work for you if you find yourself signing PDFs regularly.
NReco.PdfGenerator, sadly, does not offer any support for digitally signing PDFs, but you can make use of third party libraries such as iTextSharp in order to do this.
For more signing examples, visit the IronPDF How-To guide for this topic.
IronPDF Example:
using IronPdf;
// Stamps a Watermark onto a new or existing PDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
using IronPdf;
// Stamps a Watermark onto a new or existing PDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
Imports IronPdf
' Stamps a Watermark onto a new or existing PDF
Private renderer = New ChromePdfRenderer()
Private pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center)
pdf.SaveAs("C:\Path\To\Watermarked.pdf")
NReco.PdfGenerator Example: NReco.PdfGenerator does not natively support watermarking.
Are you familiar with HTML and CSS? Because if so, you can take advantage of IronPDF's use of HTML/CSS in its watermarking tool to have full control over the entire process. If not, The intuitive and easy-to-learn aspects of the watermarking control will make you feel like a pro in no time.
If you are using NReco.PdfGenerator and want to watermark your freshly converted PDF files, you will need to install an external library, such as PDFSharp.
For more watermark examples, visit the IronPDF How-To guide on this topic.
IronPDF Example:
using IronPdf;
using IronPdf.Editing;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");
using IronPdf;
using IronPdf.Editing;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create text stamper
TextStamper textStamper = new TextStamper()
{
Text = "Text Stamper!",
FontFamily = "Bungee Spice",
UseGoogleFont = true,
FontSize = 30,
IsBold = true,
IsItalic = true,
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the text stamper
pdf.ApplyStamp(textStamper);
pdf.SaveAs("stampText.pdf");
Imports IronPdf
Imports IronPdf.Editing
Imports System
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
' Create text stamper
Private textStamper As New TextStamper() With {
.Text = "Text Stamper!",
.FontFamily = "Bungee Spice",
.UseGoogleFont = True,
.FontSize = 30,
.IsBold = True,
.IsItalic = True,
.VerticalAlignment = VerticalAlignment.Top
}
' Stamp the text stamper
pdf.ApplyStamp(textStamper)
pdf.SaveAs("stampText.pdf")
using IronPdf;
using IronPdf.Editing;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create image stamper
ImageStamper imageStamper = new ImageStamper(new Uri("https://ironpdf.com/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
using IronPdf;
using IronPdf.Editing;
using System;
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>");
// Create image stamper
ImageStamper imageStamper = new ImageStamper(new Uri("https://ironpdf.com/img/svgs/iron-pdf-logo.svg"))
{
VerticalAlignment = VerticalAlignment.Top,
};
// Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0);
pdf.SaveAs("stampImage.pdf");
Imports IronPdf
Imports IronPdf.Editing
Imports System
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Example HTML Document!</h1>")
' Create image stamper
Private imageStamper As New ImageStamper(New Uri("https://ironpdf.com/img/svgs/iron-pdf-logo.svg")) With {.VerticalAlignment = VerticalAlignment.Top}
' Stamp the image stamper
pdf.ApplyStamp(imageStamper, 0)
pdf.SaveAs("stampImage.pdf")
NReco.PdfGenerator Example: NReco.PdfGenerator does not natively support HTML stamping.
IronPDF offers you robust text and image stamping tools, with an approach that closely resembles HTML and CSS, you will have total control over the stamping process. Whereas NReco.PdfGenerator, again, requires an external library such as iTextSharp or PDFSharp in order to stamp text and images onto your newly converted PDF documents.
For more stamping examples, visit the IronPDF How-To guide on this topic.
IronPDF Example:
using IronPdf;
// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
using IronPdf;
// Instantiate Renderer
DocxToPdfRenderer renderer = new DocxToPdfRenderer();
// Render from DOCX file
PdfDocument pdf = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx");
// Save the PDF
pdf.SaveAs("pdfFromDocx.pdf");
Imports IronPdf
' Instantiate Renderer
Private renderer As New DocxToPdfRenderer()
' Render from DOCX file
Private pdf As PdfDocument = renderer.RenderDocxAsPdf("Modern-chronological-resume.docx")
' Save the PDF
pdf.SaveAs("pdfFromDocx.pdf")
NReco.PdfGenerator Example: NReco.PdfGenerator does not natively support DOCX to PDF conversion.
Using IronPDF, you can convert your DOCX files to a PDF format in just a few lines of code. The simplistic implementation of this tool ensures an efficient workspace, without losing out on any of the quality in the resulting PDF file. With NReco.PdfGenerator, you wont be able to convert DOCX to PDF, as the library's main focus is on HTML to PDF conversion. So, you will need an extra library such as Apsose.Words in your workspace in order to handle this conversion.
For more DOCX to PDF examples, visit the IronPDF How-To guide on this topic.
IronPDF has different levels and additional features for purchasing a license. Developers can also buy IronSuite which, gives you access to all of Iron Software’s products at the price of two. If you’re not ready to buy a license, IronPDF provides a free trial that lasts 30 days.
Perpetual licenses: Offers a range of perpetual licenses depending on the size of your team, your project needs, and the number of locations. Each license type comes with email support.
Lite License: This license costs $749 and supports one developer, one location, and one project.
Plus License: Supporting three developers, three locations, and three projects, this is the next step up from the lite license and costs $1,499. The Plus license offers chat support and phone support in addition to basic email support.
Professional License: This license is suitable for larger teams, supporting ten developers, ten locations, and ten projects for $2,999. It offers the same contact support channels as the previous tiers but also offers screen-sharing support.
Royalty-free redistribution: IronPDF's licensing also offers royalty-free redistribution coverage for an extra $1,999
Uninterrupted product support: IronPDF offers access to ongoing product updates, security feature upgrades, and support from their engineering team for either $999/year or a one-time purchase of $1,999 for a 5-year coverage.
Free version: NReco.PdfGenerator offers a free online HTML to PDF converter
IronPDF excels in providing extensive documentation and support:
Comprehensive Documentation: Extensive and user-friendly documentation covering all features.
24/5 Support: Active engineer support is available.
Video Tutorials: Step-by-step video guides are available on YouTube.
Community Forum: Engaged community for additional support.
For more information, check out IronPDF's extensive documentation, and visit the Iron Software YouTube Channel.
API Reference: Offers documentation about its API so you can learn how the different aspects of it works
IronPDF and NReco.PdfGenerator are both strong contenders for all your HTML to PDF conversion needs, but if you need a tool that comes with a rich set of built in features beyond just HTML to PDF conversion, then IronPDF is for you.
With a comprehensive feature set, easy learning curve, and extensive support for modern web standards and cross-platform compatibility, IronPDF will be a powerful addition to your workspace. NReco.PdfGenerator, while reliable for basic HTML to PDF conversion, lacks many of the advanced features provided by IronPDF.
You can try the 30-day free trial to check out their available features.
9 .NET API products for your office documents