A Comparison between IronPDF and PDFreactor

PDFreactor and IronPDF give engineers the tools to generate, manipulate, edit, format, and print PDF documents from various inputs. Working in .NET and .NET Core, we must choose tools that best suit our projects and requirements, and using code samples and walk-through tutorials is always useful.

Any .NET developer will tell you that a lot of research goes into projects before they are initiated. There is an old adage that says: use the right tool for the right job. PDF libraries are no exception to this rule. As a developer, you have to be properly informed about which libraries and tools are out there. Granted not all tools or libraries are created equal — some have different strengths, some have more weaknesses than others, but ultimately it is your prerogative to use the tool that best suits you and your company, and most importantly, your project.

This article will compare two of the most popular PDF libraries for .NET and .NET Core developers. These two libraries are:

  • IronPDF
  • PDFreactor

With any comparison article, it is good to try and compare the good, the bad, and the ugly wherever possible. Unfortunately, in the current technological landscape, some libraries fall quite short, whereas other libraries excel and thrive. Technology is moving at such a fast pace that it is difficult to remain up-to-date. This applies not only to third-party library creators but to developers also. Eat or be eaten, and adapt very quickly.

Let's take a look at both offerings.

What is IronPDF?

IronPDF is a commercial Grade PDF Generation library for the .NET platform, written in C#. The key concept is to avoid time-consuming PDF-generation APIs by rendering PDFs from HTML, CSS, images, and JavaScript. It works equally well in Forms Applications, Server Applications and Services, Web Applications, Secure Intranets, Console Apps, WPF Apps, and MVC patterned websites. IronPDF is compatible with any .NET Framework project from Version 4 upwards, and .NET Core from Version 2 upwards.

IronPDF C# Library Features

Some great IronPDF features include:

  • Generating PDF documents from web platforms such as HTML and ASPX
  • Reading PDF text
  • Extracting images and data from PDF documents
  • Merging, splitting, and manipulating PDFs

Improvements in 2020 include:

  • Improved PDF text extraction accuracy
  • Added support for more PDF file types
  • Improved memory footprint
  • Digital signing of encrypted PDFs now supported
  • Digital signature metadata enhancements
  • Resolved edge-case installation path and licensing issues
  • CentOS 8 and Ubuntu 20 support

Licenses start from $749.

What is PDFreactor?

C# is one of the most-used programming languages across all industries. If you are looking for a high-quality PDF converter that works seamlessly with C# and .NET, then with PDFreactor you have access to a powerful tool to render HTML pages into PDF via C#. PDFreactor is the easy, fast and modern converter engine for C# users who need to create PDFs from HTML efficiently.

PDFreactor features:

  1. Supports all HTML5 elements.
  2. Uses cutting-edge CSS3 such calc, media queries, box-shadow, text-shadow, filter. Transform, rotate, scale, elements for converting HTML + CSS to PDF.
  3. Transfers JavaScript-driven layouts to PDF.
  4. PDFreactor supports the creation of tagged PDF documents in line with accessibility guidelines.
  5. PDFreactor web apps provides professional printing features such as PDF/X, PDF/X-4p, baseline grids, and spot colors. PDF/A PDFreactor allows for the easy creation of PDF/A (1a, 1b, 2a, 2b, 2u, 3a, 3b and 3u) and PDF/UA compliant files for the long-term archiving of electronic documents.

New improvements are:

  • CSS Grid Layout
  • Page Floats
  • Continuation Markers
  • Change Bars
  • Stylable Footnotes
  • Configuration option to create inspectable PDFs. This enables the inspecting of the structure and layout of PDFs generated with PDFreactor, similar to the browser’s development tools in our new PDFreactor Inspector tool.

Licenses start from $2.950,00.

Start by Creating an ASP.NET Website

IronPDF

The next few steps generate an ASP.NET Website:

  • Open Visual Studio 2017 or Visual Studio 2019.
  • Click File New Project to generate a new project.
  • Select Web under Visual C# in the Project type list box.
  • Choose ASP.NET Web Application. This screenshot is shown below:
  • Select OK.
  • Choose Web Forms on the next screen as shown underneath:
  • Click OK.

Next, let’s install IronPDF.

1. Install IronPDF

There are two ways to install IronPDF:

  • NuGet
  • Download the library

Let’s take a closer look.

1.1. Install Library via NuGet

There are three ways to install IronPDF through NuGet; these are:

  • Visual Studio
  • Developer Command Prompt
  • Download the NuGet Package directly

Let’s take a look at them one-by-one.

1.2. Using Visual Studio

You access the NuGet Package Manager via the Project Menu, or by right-clicking your project in the Solution Explorer.

Once selected, browse for the IronPDF package and install it as shown below:

1.3. Using Developer Command Prompt

Make use of the next few steps to install the IronPDF NuGet package via the Developer Command Prompt:

  • Open Developer Command Prompt — found under the Visual Studio folder.
  • Type:

    Install-Package IronPdf
  • Press Enter.
  • Reload your Visual Studio project.

1.4. Download the NuGet Package directly

Make use of the next few steps to download the package through NuGet:

1.5. Install IronPDF by downloading the library

The second way to install IronPDF is by downloading it directly from the IronPDF DLL download.

Reference the library in your project by using the next steps:

  • Right-click the Solution in the Solution Explorer
  • Select References
  • Browse for the IronPDF.dll library
  • Click OK

PDFReactor

Follow the same steps mentioned above and install PDFreactor. This is typically used for server-side conversion of HTML to PDF, ranging from dynamic data-driven documents (reports, invoices, forms, data sheets) for electronic distribution to complex and high-quality PDFs (catalogs, marketing collateral, technical documentation, journals) for print and electronic publishing.

2. Create PDF from HTML Text Input

The next code creates PDF documents and prints an HTML string inside them.

2.1. Convert HTML String to PDF with IronPDF

The following code is using IronPDF to create PDF files directly from an HTML string.

private void HTMLString()
{
    // Render any HTML fragment or document to HTML
    var Renderer = new IronPdf.ChromePdfRenderer();
    var PDF = Renderer.RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");
    Renderer.RenderingOptions.TextFooter = new HtmlHeaderFooter() { HtmlFragment = "<div style='text-align:right'><em style='color:pink'>page {page} of {total-pages}</em></div>" };
    var OutputPath = "ChromePdfRenderer.pdf";
    PDF.SaveAs(OutputPath);
    Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
}
private void HTMLString()
{
    // Render any HTML fragment or document to HTML
    var Renderer = new IronPdf.ChromePdfRenderer();
    var PDF = Renderer.RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");
    Renderer.RenderingOptions.TextFooter = new HtmlHeaderFooter() { HtmlFragment = "<div style='text-align:right'><em style='color:pink'>page {page} of {total-pages}</em></div>" };
    var OutputPath = "ChromePdfRenderer.pdf";
    PDF.SaveAs(OutputPath);
    Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
}
Private Sub HTMLString()
	' Render any HTML fragment or document to HTML
	Dim Renderer = New IronPdf.ChromePdfRenderer()
	Dim PDF = Renderer.RenderHtmlAsPdf("<h1>Hello IronPDF</h1>")
	Renderer.RenderingOptions.TextFooter = New HtmlHeaderFooter() With {.HtmlFragment = "<div style='text-align:right'><em style='color:pink'>page {page} of {total-pages}</em></div>"}
	Dim OutputPath = "ChromePdfRenderer.pdf"
	PDF.SaveAs(OutputPath)
	Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
End Sub
VB   C#

2.1. Convert HTML String to PDF with PDFreactor

The following code is using PDFreactor to create PDF files directly from an HTML string.

<script>
            window.onload = async function() {
                // Create new PDFreactor instance
                var pdfReactor = new PDFreactor("https://cloud.pdfreactor.com/service/rest");
                // Create a new PDFreactor configuration object
                var config = {
                    // Specify the input document
                    document: "http://www.pdfreactor.com/product/samples/textbook/textbook.html",
                }       
                // Render document and save result
                try {
                    var result = await pdfReactor.convert(config);
                    document.getElementById("result").src = "data:application/pdf;base64," + result.document;
                } catch (error) {
                    if (error instanceof PDFreactor.PDFreactorWebserviceError) {
                        document.body.innerHTML = "<h1>An Error Has Occurred</h1><h2>" + error.message + "</h2>";
                    }
                }
            }
        </script>
<script>
            window.onload = async function() {
                // Create new PDFreactor instance
                var pdfReactor = new PDFreactor("https://cloud.pdfreactor.com/service/rest");
                // Create a new PDFreactor configuration object
                var config = {
                    // Specify the input document
                    document: "http://www.pdfreactor.com/product/samples/textbook/textbook.html",
                }       
                // Render document and save result
                try {
                    var result = await pdfReactor.convert(config);
                    document.getElementById("result").src = "data:application/pdf;base64," + result.document;
                } catch (error) {
                    if (error instanceof PDFreactor.PDFreactorWebserviceError) {
                        document.body.innerHTML = "<h1>An Error Has Occurred</h1><h2>" + error.message + "</h2>";
                    }
                }
            }
        </script>
'INSTANT VB TODO TASK: Local functions are not converted by Instant VB:
'(Of script) window.onload = async @function()
'{
'				' Create new PDFreactor instance
'				var pdfReactor = New PDFreactor("https://cloud.pdfreactor.com/service/rest");
'				' Create a new PDFreactor configuration object
'				var config = { document: "http://www.pdfreactor.com/product/samples/textbook/textbook.html"} try
'				{
'					var result = await pdfReactor.convert(config);
'					document.getElementById("result").src = "data:application/pdf;base64," + result.document;
'				}
'				catch (@error)
'				{
'					if (@error instanceof PDFreactor.PDFreactorWebserviceError)
'					{
'						document.body.innerHTML = "<h1>An Error Has Occurred</h1><h2>" + @error.message + "</h2>";
'					}
'				}
'			}
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'		</script>
VB   C#

3. ASPX Pages to PDF

The next code creates PDF files from an ASPX page.

3.1. ASPX Pages to PDF with IronPDF

The following code makes use of IronPDF to create a PDF from an ASPX file.

protected void Page_Load(object sender, EventArgs e)
{
    IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
protected void Page_Load(object sender, EventArgs e)
{
    IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
	IronPdf.AspxToPdf.RenderThisPageAsPdf()
End Sub
VB   C#

3.2. ASPX Pages to PDF with PDFreactor

It seems as if PDFreactor does not support creating PDFs from ASPX web pages.

4. Using CSS3 with PDF Documents

  • HTML to PDF supports:
  • Full and high-fidelity HTML 4 and HTML 5 rendering
  • CSS 3
  • JavaScript
  • Image assets
  • SVG assets
  • Responsive layouts
  • External stylesheets and assets (HTTP, HTTPS or filesystem)
  • Static and multithreaded rendering
  • Loading URLs using with custom:
    • Network login credentials
    • UserAgent
    • Proxies
    • Cookies
    • HTTP headers
    • Form variables allowing login behind HTML login forms

4.1. Cascading Style Sheets CSS3

Cascading Style Sheets (CSS) describes the look and formatting of HTML files. It makes use of selectors and properties to set the formatting of an entire web page or website in one central place. CSS3 is the latest standard. CSS3 includes:

  • Media Queries
  • Namespaces
  • Selectors Level 3
  • Modules including:
    • Selectors
    • Box Model
    • Text Effects
    • 2D Transformations
    • 3D Transformations
    • Backgrounds
    • User Interface

With IronPDF you have a choice where you’d like the CSS styles to render to: Screen or Print. When dealing with the screen, you must be informed about responsiveness. To distinguish between the screen or printer, you could use the following quick line of code:

Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print
//or
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print
//or
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Print Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
VB   C#

4.2. Responsive Web Design

Responsive web design enables web pages and websites that look good on all devices. Responsive webs automatically adjust according to different screen sizes and viewports. While working with responsive design and frameworks such as Bootstrap, IronPDF can set the ViewPortWidth and ViewPortHeight properties to programmatically control the viewport, and control which version of the responsive site to render as a PDF.

4.3. Creating a Response ViewPort

The following code allows you to programmatically set the size of your response Viewport with IronPDF.

using IronPdf;
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
 //Choose screen or print CSS media
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
//Set the width of the responsive virtual browser window in pixels
Renderer.ViewPortWidth = 1280; 
// Render an HTML document or snippet as a string
Renderer.RenderHTMLFileAsPdf("Assets/Responsive.html");
using IronPdf;
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
 //Choose screen or print CSS media
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
//Set the width of the responsive virtual browser window in pixels
Renderer.ViewPortWidth = 1280; 
// Render an HTML document or snippet as a string
Renderer.RenderHTMLFileAsPdf("Assets/Responsive.html");
Imports IronPdf
Private Renderer As New IronPdf.ChromePdfRenderer()
 'Choose screen or print CSS media
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
'Set the width of the responsive virtual browser window in pixels
Renderer.ViewPortWidth = 1280
' Render an HTML document or snippet as a string
Renderer.RenderHTMLFileAsPdf("Assets/Responsive.html")
VB   C#

4.4. HTML Templates

Another great feature is the ability to create HTML templates from which to work and build similar PDF documents. Here is a small example:

var HtmlTemplate = "<p>[[NAME]]</p>";
var Names = new[] { "John", "James", "Jenny" };
foreach (var name in Names) {
    var HtmlInstance = HtmlTemplate.Replace("[[NAME]]", name);
    var Pdf = Renderer.RenderHtmlAsPdf(HtmlInstance);
    Pdf.SaveAs(name + ".pdf");
}
var HtmlTemplate = "<p>[[NAME]]</p>";
var Names = new[] { "John", "James", "Jenny" };
foreach (var name in Names) {
    var HtmlInstance = HtmlTemplate.Replace("[[NAME]]", name);
    var Pdf = Renderer.RenderHtmlAsPdf(HtmlInstance);
    Pdf.SaveAs(name + ".pdf");
}
Dim HtmlTemplate = "<p>[[NAME]]</p>"
Dim Names = { "John", "James", "Jenny" }
For Each name In Names
	Dim HtmlInstance = HtmlTemplate.Replace("[[NAME]]", name)
	Dim Pdf = Renderer.RenderHtmlAsPdf(HtmlInstance)
	Pdf.SaveAs(name & ".pdf")
Next name
VB   C#

6. Free Personal license

As written in the PDFreactor Software License Agreement, a PDFreactor license can only be used on one physical or virtual machine or isolated software container. So, for each production machine, you require one license. If you are going to use PDFreactor on a non-commercial basis, you can request a free personal license here.

IronPDF is an openly commercial C# PDF library. It is free for development, with 30-day deployment trials available by emailing the engineering team at developers@ironpdf.com. Affordable licensing options can be found by exploring the IronPDF Licenses.

7. Summary And Conclusion

Summary

IronPDF is a supported, productivity-first .NET library that can:

  • Render PDFs from HTML using a fully-embedded web browser
  • Edit and manipulate high-quality PDFs
  • Digitally Sign PDF conversion

PDFreactor is a free HTML to PDF converter for private, non-commercial, and non-professional use.

  • Easily convert HTML to PDF. Supports HTML5, CSS3, JavaScript. APIs for JavaScript, Java, PHP, .NET, Python, Ruby, Perl, Node.js, SOAP, REST.

Conclusion

IronPDF takes care of the difficult problem of adding PDF generation to your app, and automates turning formatted documents into a PDF. All products are free for development and testing within IDE, with no time restrictions. and can be installed via NuGet. It converts web forms, local HTML pages, and other web pages to PDF with .NET, and allows users to download documents, send them by email, or store them in the cloud

While PDFreactor is a powerful formatting processor that enables server-side PDF conversion from HTML 5 documents using CSS to define page layout and styles. You can dynamically generate PDF documents such as reports, invoices, statements, and others on the fly. By implementing the W3C specification for paged media and print, PDFreactor provides great control over the paged output via CSS. To use PDFreactor in a production environment, an appropriate license is required.