PRODUCT COMPARISONS

A Comparison between IronPDF and GemBox.Pdf

Updated April 11, 2022
Share:

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

  • IronPDF
  • GemBox

IronPDF and GemBox are both libraries that provide methods to create, manipulate and print PDFs in .NET and .NET Core. The next question is to decide which C# PDF Library is best suited for your .NET project. You can weigh up your decision as you read the following comparison between the two libraries and their respective standout features for converting and manipulating PDFs.

The IronPDF Library

The IronPDF .NET PDF Library solution is a dream for developers, especially software engineers who use C#. You can easily create a core PDF library for .NET with this excellent tool.

IronPDF uses a .NET Chromium engine to render HTML pages to PDF files. With HTML to PDF there is no need to use complex APIs to position or design PDFs. IronPDF supports standard web documents: 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, stamp, and add headers and footers to a PDF. Further, it makes it very easy to read PDF text and extract images.

Stand-out features of the IronPDF library include:

Create PDFs (HTML to PDF)

  • Create PDF documents from HTML 4 and 5, CSS, and JavaScript
  • Generate PDF documents from URL
  • Load URLs with custom-network login credentials, user-agents, proxies, cookies, HTTP headers, and form variables allowing login behind HTML login forms

Edit Existing PDF Documents Without Adobe Acrobat

  • Read and fill PDF form-field data
  • Extract images and texts from PDFs
  • Stamp new HTML Content onto any existing page
  • Add logical or HTML headers and footers
  • Digitally Sign

Manipulate Existing PDF Documents

  • Load and parse existing documents
  • Merge and split content in documents
  • Add headers, footers, annotations, bookmarks, watermarks, text, and assets

Convert from Multiple Formats

  • ASPX WebForms — convert, with 3 lines of code, ASP.NET webforms to downloadable PDFs viewable in the browser
  • 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
  • Screen or Print 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

Note: Now, you can also purchase Iron Suite for .NET (IronPDF, IronOCR, IronXL, IronBarcode, IronWebscraper, IronPrint, IronWord, IronQR, and IronZIP).

GemBox.Pdf Library

GemBox offers fast and easy–to–use .NET components for developers, with a strong focus on file formats and well–documented APIs. The GemBox Bundle is a package of .NET components that enable you to process PDF files, spreadsheet files, documents, presentations, and emails simply and efficiently in .NET applications.

For working with PDF files, GemBox provides the GemBox.Pdf library. With GemBox.Pdf, developers can read, write, merge, split and perform other low-level operations on PDFs efficiently. GemBox.Pdf doesn’t require Adobe Acrobat, so you can deploy your application easily without having to think about other licenses.

Standout features of GemBox.Pdf include:

  • View PDF files in WPF applications
  • Print, merge, split PDF files
  • Create, fill in, flatten, read, and export PDF interactive forms
  • Extract a Unicode representation of a PDF page and individual text elements with their bounds and font
  • Extract images from PDF files
  • Extract text from images or scanned PDF files with optical character recognition (OCR)
  • Encrypt and digitally sign PDF files
  • Get and set document properties
  • Add watermarks, headers and footers to PDF pages
  • Get, create, remove or reorder pages
  • Add text, images, shapes (paths), form XObjects, content groups, and marked content to pages and format (fill, stroke, and clip) the content
  • Annotate PDF pages with hyperlinks
  • Medium trust support
  • Use private fonts to bypass medium trust environment restrictions

GemBox.Pdf works with .NET Framework 3.5+, .NET Standard 2.0, and .NET 6.0.

Note: Use GemBox.Spreadsheet to convert Microsoft Excel spreadsheet files(csv, xls, xlsx) to PDF; for converting Word and HTML documents to PDFs, use Gembox.Document; and use Gembox.Presentation for converting PowerPoint presentations to PDF files.

Overview

The rest of this article will look at the following topics:

  1. Creating a Project
  2. IronPDF C# Library Installation
  3. GemBox Installation
  4. Convert Images to PDF
  5. Licensing
  6. Summary and Conclusion

1. Creating an ASP.NET Project

Use the following steps to create an ASP.NET website:

  • Open Visual Studio
  • Click on File from the menu and then click on "New Project" to create a new project
  • Select Web under Visual C# in the project type list box
  • Select ASP.NET Web Application (.NET) and click OK as shown in the below screenshot

Figure 1New Project Dialog Box

  • From the next screen, choose "Web Forms" as shown in the screenshot below.

Figure 2Web Forms

  • Once selected, click OK.

Now the project is created, and we are almost ready to test the libraries. However, we still need to install them into our project. Let's install IronPDF first.

2. IronPDF C# Library Installation

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

  1. Using Visual Studio
  2. The Developer Command Prompt
  3. Download the NuGet Package directly
  4. Download the IronPDF .DLL Library

Let’s take a closer look at each one.

2.1. Using Visual Studio

Visual Studio provides the NuGet Package Manager for installing NuGet packages in your projects. You can access it through the Project Menu, or by right-clicking your project in the Solution Explorer.

Figure 3Solution Explorer

Figure 4Project Menu > Manage NuGet Packages

Once selected, browse for the IronPDF package and install it, as shown in the screenshot below.

Figure 5Install IronPDF from NuGet Package

2.2. Using the Developer Command Prompt

Another way to download and install the IronPDF C# Library is to make use of the following steps to install the IronPDF NuGet package through the Developer Command Prompt.

  • Open the Developer Command Prompt — usually found in the Visual Studio folder.

Type the following command:

Install-Package IronPdf
  • Press Enter
  • This will download and install the package
  • Reload your Visual Studio project and begin using it

2.3. Download the NuGet Package Directly

The third way to download and install IronPDF is to follow the steps below. This can be done by visiting the NuGet site directly and downloading the package. The steps are:

  • Navigate to the IronPDF NuGet Gallery Page.
  • Select "Download Package"
  • Double-click the downloaded package
  • The package will be installed
  • Reload your Visual Studio project and begin using it

2.4. Install IronPDF by Downloading the Library

You can directly download the IronPDF .DLL file directly from the website. It can be directly downloaded from the IronPDF website.

Figure 6Download IronPDF Library

Follow the steps below to include the DLL as a reference in your project:

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

All done! IronPDF is downloaded, installed and ready to use.

3. GemBox.Pdf Installation

You can install the GemBox.Pdf library by either:

  1. Using the NuGet Package Manager
  2. Including its DLL as a project reference
  3. Using the GemBox.Pdf Installer

3.1. Using the NuGet Package Manager

Most .NET developers choose to start with the NuGet package, and then often revert to using its free trial.

From the NuGet Package Manager Console, enter the following command:

Install-Package GemBox.Pdf

Alternatively, you can add GemBox.Pdf from the NuGet Package Manager GUI within Visual Studio.

3.3. Adding the GemBox.Pdf DLL as a Project Reference

  1. Download the GemBox.Pdf.dll from the offical Downloads page page.
  2. Right click the project within the Visual Studio Solution Explorer and selecting Add Project Reference.
  3. Click the Browse button within the window that opens and navigate to the location of the DLL that you downloaded in step 1 and select it.
  4. Click OK to add the DLL to the project

3.4. Using the GemBox.Pdf Installer

Download and install the GemBox.Pdf Setup installer from the GemBox.Pdf Free Version installation page.

Using GemBox.Pdf

Before you can start using GemBox.Pdf in your projects, you must first include the GemBox.Pdf namespace in your project source files:

using GemBox.Pdf;
using GemBox.Pdf;
Imports GemBox.Pdf
VB   C#

Additionally, you must configure the GemBox.Pdf component with a valid license key. We will be using the Free version of the library for this tutorial, so we will use the line of code below to set the library to "Free Mode."

ComponentInfo.SetLicense("FREE-LIMITED-KEY");
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
ComponentInfo.SetLicense("FREE-LIMITED-KEY")
VB   C#

4. Convert Images to PDF

4.1. Images to PDF using IronPDF

Build documents containing one or more image files using the IronPdf.ImageToPdfConverter class.

// One or more images as IEnumerable.  This example selects all JPEG images in a specific folder.
var ImageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));

// Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs(@"C:\project\composite.pdf");

//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
// One or more images as IEnumerable.  This example selects all JPEG images in a specific folder.
var ImageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));

// Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs(@"C:\project\composite.pdf");

//Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
' One or more images as IEnumerable.  This example selects all JPEG images in a specific folder.
Dim ImageFiles = System.IO.Directory.EnumerateFiles("C:\project\assets").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg"))

' Convert the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("C:\project\composite.pdf")

'Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
VB   C#

4.2. Images to PDF using GemBox.Pdf

With GemBox.Pdf, you can easily convert images in different file formats such as JPG, GIF, TIFF, and PNG to PDF documents programmatically using C#. Gembox.Pdf can convert images in either of these formats: BMP, GIF, JPEG, PNG, TIFF, WMP.

// One or more images as IEnumerable. This example selects all JPEG images in a specific folder.
var imageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));
// Create new document.
using (var document = new PdfDocument())
{
    foreach (var imageFile in imageFiles)
    {
        // Load image and add new page.
        var image = PdfImage.Load(imageFile);
        var page = document.Pages.Add();
        // Add image to the page and set page size.
        page.Content.DrawImage(image, new PdfPoint(0, 0));
        page.SetMediaBox(image.Size.Width, image.Size.Height);
    }
    // Save document.
    document.Save(@"C:\project\composite.pdf");
}
// One or more images as IEnumerable. This example selects all JPEG images in a specific folder.
var imageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));
// Create new document.
using (var document = new PdfDocument())
{
    foreach (var imageFile in imageFiles)
    {
        // Load image and add new page.
        var image = PdfImage.Load(imageFile);
        var page = document.Pages.Add();
        // Add image to the page and set page size.
        page.Content.DrawImage(image, new PdfPoint(0, 0));
        page.SetMediaBox(image.Size.Width, image.Size.Height);
    }
    // Save document.
    document.Save(@"C:\project\composite.pdf");
}
' One or more images as IEnumerable. This example selects all JPEG images in a specific folder.
Dim imageFiles = System.IO.Directory.EnumerateFiles("C:\project\assets").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg"))
' Create new document.
Using document = New PdfDocument()
	For Each imageFile In imageFiles
		' Load image and add new page.
		Dim image = PdfImage.Load(imageFile)
		Dim page = document.Pages.Add()
		' Add image to the page and set page size.
		page.Content.DrawImage(image, New PdfPoint(0, 0))
		page.SetMediaBox(image.Size.Width, image.Size.Height)
	Next imageFile
	' Save document.
	document.Save("C:\project\composite.pdf")
End Using
VB   C#

5. Licensing

GemBox.Pdf can be used as a free version or as a professional version depending on user needs. Download the free version of GemBox.Pdf using the instructions stated above.

The professional version comes with 12 months of free bug fixes, new releases, and technical support. Furthermore, the use of the professional version requires a developer license for each user. All licenses include a no-risk money-back guarantee for 30 days. There is no need for a subscription and no need for server or OEM licenses. Detailed licensing is available here. Individual developer licensing starts from $890.

IronPDF is an openly commercial C# PDF library. It is free for development and can be licensed for commercial deployment. Licenses are available for single-project use, single 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). The Lite package starts from $749.

6. Summary

IronPDF provides a comprehensive collection of functions for performing all kinds of tasks on PDF documents. It provides the ability to convert from different formats to PDF. Its key feature is its ability to convert HTML into PDFs. Unlike other libraries, this HTML-to-PDF conversion feature does not require involvement from a remote server. Instead, it actually spins up an instance of a real, standards-compliant web browser behind the scenes. 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.

GemBox is a collection of .NET components for processing office productivity files — spreadsheets, documents, presentations, and emails. The GemBox.Pdf library reads, writes, creates and updates PDF files in .NET 6, .NET Core, .NET Framework, Mono, and Xamarin. If you want to create complex PDF documents, use GemBox.Document, GemBox.Spreadsheet, and GemBox.Presentation, which all have PDF exporting capability. It is free to use and can also be licensed for commercial use.


Right now, you can buy nine IronPDF products for the price of just two. Check out this exclusive special offer right here

All trademarks in this article are properties of their respective owners.

< PREVIOUS
A Comparison between IronPDF and ITextPDF
NEXT >
A Comparison between IronPDF and PDFTron

Ready to get started? Version: 2024.7 just released

Free NuGet Download Total downloads: 9,974,197 View Licenses >
123