PRODUCT COMPARISONS

A Comparison between IronPDF and XFINIUM.PDF

Published September 27, 2022
Share:

Ever-improving technology means smarter solutions for everyone, especially developers. Automation is now the key to software development processes. Working with C# PDF files has been problematic for developers for many years. There are many factors to consider when creating content for PDF files, and even more so when converting content from different formats to PDF. These issues have now been resolved with the construction of multiple libraries designed to help read, write, create and convert to PDFs from different formats.

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

  • The IronPDF library
  • The XFININIUM.PDF library

IronPDF and XFININUM.PDF are two libraries that provide methods for creating, manipulating, and printing PDFs in .NET and .NET Core. The next question is deciding which C# PDF library is best for your .NET project. You can weigh your decision by reading the following comparison between the two libraries and their respective outstanding features for PDF conversion and manipulation.

First, let's take a look at what the two libraries have to offer, and then move on to the comparison itself.

The XFINIUM.PDF library and its features

The XFINIUM.PDF library is a cross-platform library for PDF development. It provides a wide variety of capabilities both for the amateur and the superior PDF developer. Whether you want to create a report, fill a PDF form, construct a PDF portfolio, redact touchy data from a PDF report or convert a PDF report to a multipage TIFF image.

XFINIUM.PDF is available in two editions: the Generator Edition, which includes PDF production and editing, and the Viewer Edition, which contains all of the functionality of the Generator Edition plus PDF rendering and PDF viewing. The Features section explains which features are included in both editions, and which are only available in the Viewer Edition.

XFINIUM.PDF was written entirely in C# and is completely managed code. It is licensed per developer with royalty-free distribution, allowing you to freely distribute your program without incurring any further costs.

What is the difference between the Generator and Viewer Editions?

The Generator Edition is a subset of the Viewer Edition. The Generator Edition offers PDF functionality for creating and editing PDFs, while the Viewer Edition adds PDF rendering capabilities to the Generator Edition. The Viewer Edition can convert PDF pages to RAW, BMP, GIF, JPG, PNG, and TIFF images.

XFINIUM.PDF Specification

Some of the important features include:

Security

  • User and owner passwords
  • Document access rights
  • 40-bit and 128-bit RC4 encryption
  • 128-bit and 256-bit AES encryption
  • Content redaction
  • Disable text copy/paste

Digital Signatures

  • Approval and certification of digital signatures with X509 certificates
  • Basic CMS and PAdES digital signatures with SHA256 / SHA384 / SHA512
  • Signature timestamps
  • OCSP and CRL information included in digital signatures
  • Document security store
  • Document timestamps
  • LTV (Long Term Validation) enabled digital signatures
  • Decode existing signatures into ASN.1 objects
  • Extract the certificate from digital signatures
  • Save signed copies of PDF documents

Barcode

  • Built-in vector barcode engine, no barcode images or barcode fonts
  • Unidimensional barcodes:
    • Generic barcodes: Codabar, Code 11, Code 25, Code 25 Interleaved, Code 39, Code 39 Extended, Code 93, Code 93 Extended, Code 128 A, Code 128 B, Code 128 C, COOP 25, Matrix 25, MSI/Plessey
    • Pharmaceutical barcodes: Code 32, Pharmacode, PZN (Pharma-Zentral-Nummer)
  • Bidimensional barcodes:
    • DataMatrix, QR, PDF417, Micro PDF417, Codablock F, Code 16K

Content Extraction

  • Extract text with position information at fragment level and glyph level
  • Extract text as words with position information at word level and glyph level
  • Extract text and words from user-defined regions
  • Extract images including image information such as image size in pixels, bits per pixel, colorspace, image position on the PDF page, image size on the PDF page, image horizontal and vertical resolution

Low-Level COS API

  • Add, edit and remove COS objects
  • Supported COS objects: strings, numbers, names, booleans, nulls, arrays, dictionaries, and streams

PDF Rendering (Viewer Edition Only)

  • Render PDF pages to images: RAW, BMP, GIF, JPG, PNG, and TIFF ARGB, RGBA, BGRA, RGB, BGR, and Grayscale byte layouts for RAW images
  • PDF to multipage TIFF (color/grayscale/B&W CCITT G4)

The Main Features of IronPDF

The IronPDF .NET PDF library is a dream come true for developers, especially C# programmers. With this amazing tool, you can easily construct a core PDF library for .NET.

IronPDF converts HTML pages to PDF files using the .NET Chromium engine. There is no need to use complicated APIs to position or design PDFs with HTML to PDF. Standard online documents are supported by IronPDF, including HTML, ASPX, JS, CSS, and pictures.

You can also use HTML5, CSS, JavaScript, and pictures to develop a .NET PDF library. A PDF can be easily edited, stamped, and added with headers and footers. It also makes reading PDF text and extracting graphics a breeze.

Download IronPDF for free and start using it in your .NET projects today.

Standout Features of the IronPDF C# Library

Here are some of the key features:

Produce PDFs (HTML to PDF)

  • HTML4/5, CSS, and JavaScript can all be used to create PDF documents.
  • Load URL with custom network login credentials, user agents, proxies, cookies, HTTP headers, and form variables to enable login behind HTML login forms.

You can edit existing PDF documents without Adobe Acrobat

  • Data from the form fields should be read and filled in.
  • From a PDF, extract graphics and text.
  • Any current PDF page can be updated with new HTML content.
  • Headers and footers should be logical or HTML.

Existing PDF documents can be manipulated

  • Existing PDF documents can be loaded and parsed.
  • Content in PDF documents can be merged and separated.
  • Add headers, footers, annotations, bookmarks, watermarks, text, and image assets, as well as text and image assets.

Convert from a variety of file formats

  • ASPX WebForms — convert ASP.NET webforms to printable PDFs that can be viewed in the browser with just three lines of code.
  • Convert HTML to PDF in a document.
  • Custom 'base URL' to allow asset files to be accessed from anywhere on the internet.
  • Virtual Viewport allows for responsive design (width and height).
  • Accept HTML files encoded in any of the major file formats (default to UTF-8).

Print and save

  • Files, binary data, and MemoryStreams can all be saved and loaded.
  • A television or a computer screen CSS media types for printing.
  • Print PDF files without Adobe Acrobat by converting them to a PrintDocument object (with minimal code).
  • Official log files containing information about API success and debug faults in source code can be exported.

IronPDF is available on almost all operating systems and frameworks compatible with C#, including the following:

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

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

Using Visual Studio

Visual Studio provides the NuGet Package Manager to install NuGet packages in your projects. You can access it through the Project Menu, or by right-clicking your project in the Solution Explorer. Both these options are shown below in screenshots as Figures 1 and 2.

Accessing the NuGet Package Manager using the Project Menu in Visual Studio

Figure 1. Accessing the NuGet Package Manager using the Project Menu in Visual Studio

Accessing the NuGet Package Manager using the Context Menu in Visual Studio

Figure 2. Accessing the NuGet Package Manager using the context menu in Visual Studio

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

Installing the IronPDF library using the NuGET Package Manager in Visual Studio

Figure 3. Installing the IronPDF library using the NuGET Package Manager in Visual Studio

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 under 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

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 IronPdf NuGet Page
  • Select Download Package
  • Double-click the downloaded package
  • The package will be installed
  • Reload your Visual Studio project and begin using it

Install IronPDF by Downloading the Library

You can download the IronPDF .DLL file directly from the IronPDF Download.

Downloading the IronPDF Library DLL from the IronPDF website

Figure 4. Downloading the IronPDF Library DLL from the IronPDF website

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

All done! IronPDF is downloaded, installed, and ready to use. However, before that, we should install the XFINIUM.PDF API.

XFINIUM.PDF Installation

In .NET Core, we can install Xfinium PDF either as a cake addin or a cake tool.

// Install Xfinium.Pdf.NetCore as a Cake Addin

#addin nuget:?package=Xfinium.Pdf.NetCore&version=10.2.0
// Install Xfinium.Pdf.NetCore as a Cake Tool

#tool nuget:?package=Xfinium.Pdf.NetCore&version=10.2.0

Next, let's delve into the comparison between IronPDF and XFINIUM.PDF.

Creating a simple PDF document in .NET Core

In today's world, software developers must know how to create a PDF file dynamically using C# code, as this is needed in practically all projects. You might need to create a PDF file for a variety of reasons, such as generating a report from user input, saving user text as PDF, extracting HTML information and converting it to PDF, and so forth.

The ability to convert an HTML webpage to PDF is included in both libraries. Let's take a look at each library's code one by one.

Using IronPDF

IronPDF has multiple methods for creating PDF files.

Existing URL to PDF

IronPDF makes it simple to convert HTML into PDF documents from existing URLs. JavaScript, images, forms, and CSS all have a high level of support.

IronPDF is used in the following code to create a PDF document directly from a website address.

IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
Pdf.SaveAs("url.pdf");
IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
using var Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");
Pdf.SaveAs("url.pdf");
Dim Renderer As New IronPdf.ChromePdfRenderer()
Dim Pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")
Pdf.SaveAs("url.pdf")
VB   C#

HTML Input String to PDF

The following code demonstrates how an HTML input string can be used to render a PDF page. You can use just HTML, or combine it with CSS, pictures, and JavaScript.

var Renderer = new IronPdf.ChromePdfRenderer();
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");
// Load external html assets: images, css and javascript.
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from 
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
var Renderer = new IronPdf.ChromePdfRenderer();
using var PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
PDF.SaveAs("pixel-perfect.pdf");
// Load external html assets: images, css and javascript.
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from 
using var AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
AdvancedPDF.SaveAs("html-with-assets.pdf");
Dim Renderer = New IronPdf.ChromePdfRenderer()
Dim PDF = Renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>")
PDF.SaveAs("pixel-perfect.pdf")
' 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 AdvancedPDF = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
AdvancedPDF.SaveAs("html-with-assets.pdf")
VB   C#

Using XFINIUM.PDF

Using XFINIUM.PDF to create a blank PDF document requires only three lines of code: one line to create the document, one line to create one page, and another line to save the document.

PdfFixedDocument document = new PdfFixedDocument();
PdfPage page = document.Pages.Add();
document.Save("empty.pdf");
PdfFixedDocument document = new PdfFixedDocument();
PdfPage page = document.Pages.Add();
document.Save("empty.pdf");
Dim document As New PdfFixedDocument()
Dim page As PdfPage = document.Pages.Add()
document.Save("empty.pdf")
VB   C#

Three additional lines of code are required to add text content to the document above: one for font creation for drawing the text, one for brush creation and for setting the text color, and the other for actually drawing text and graphics on the page.

PdfFixedDocument document = new PdfFixedDocument();
PdfPage page = document.Pages.Add();
// Create a standard font with Helvetica face and 24 point size
PdfStandardFont helvetica = new PdfStandardFont(PdfStandardFontFace.Helvetica, 24);
// Create a solid RGB red brush.
PdfBrush brush = new PdfBrush(PdfRgbColor.Red);
// Draw the text on the page.
page.Graphics.DrawString("Hello World", helvetica, brush, 100, 100);
document.Save("helloworld.pdf");
PdfFixedDocument document = new PdfFixedDocument();
PdfPage page = document.Pages.Add();
// Create a standard font with Helvetica face and 24 point size
PdfStandardFont helvetica = new PdfStandardFont(PdfStandardFontFace.Helvetica, 24);
// Create a solid RGB red brush.
PdfBrush brush = new PdfBrush(PdfRgbColor.Red);
// Draw the text on the page.
page.Graphics.DrawString("Hello World", helvetica, brush, 100, 100);
document.Save("helloworld.pdf");
Dim document As New PdfFixedDocument()
Dim page As PdfPage = document.Pages.Add()
' Create a standard font with Helvetica face and 24 point size
Dim helvetica As New PdfStandardFont(PdfStandardFontFace.Helvetica, 24)
' Create a solid RGB red brush.
Dim brush As New PdfBrush(PdfRgbColor.Red)
' Draw the text on the page.
page.Graphics.DrawString("Hello World", helvetica, brush, 100, 100)
document.Save("helloworld.pdf")
VB   C#

Our object model closely resembles the PDF standard. This allows you to easily build complicated abstractions on top of it, such as flow documents.

Making generated PDF files fillable

Using XFINIUM.PDF

The XFINIUM.PDF library can both create new PDF forms and fill existing PDF forms.

Each type of form field supported in the PDF specification is represented by the corresponding class:

  • PdfTextBoxField – textbox fields
  • PdfCheckBoxField – checkboxes
  • PdfRadioButtonField – sets of radio buttons
  • PdfComboboxField – combo boxes
  • PdfListboxField – listboxes
  • PdfPushbuttonField – push buttons
  • PdfSignatureField – signature fields

The name of the field and its location on the page are the only pieces of information needed to construct a form field. After creating the field object, it must be added to the page before any other attributes may be specified.

PdfTextBoxField firstNameTextBox = new PdfTextBoxField("firstname");
pdfpage.Fields.Add(firstNameTextBox);
firstNameTextBox.Widgets [0].VisualRectangle = 
    new PdfVisualRectangle(150, 45, 200, 20);
PdfTextBoxField firstNameTextBox = new PdfTextBoxField("firstname");
pdfpage.Fields.Add(firstNameTextBox);
firstNameTextBox.Widgets [0].VisualRectangle = 
    new PdfVisualRectangle(150, 45, 200, 20);
Dim firstNameTextBox As New PdfTextBoxField("firstname")
pdfpage.Fields.Add(firstNameTextBox)
firstNameTextBox.Widgets (0).VisualRectangle = New PdfVisualRectangle(150, 45, 200, 20)
VB   C#

Existing PDF forms can be filled if they are loaded in a PdfFixedDocument object. After the form has been loaded, the document’s fields collection is populated automatically with the fields defined in the form. A field is located in the collection by index or by its name, and it is filled by setting the generic value property defined in the PdfField base class or the specific value properties defined on each field type.

PdfFixedDocument document = new PdfFixedDocument("form.pdf");
(document.Form.Fields ["firstname"] as PdfTextBoxField).Text = "John";
(document.Form.Fields ["lastname"] as PdfTextBoxField).Value = "Doe";
(document.Form.Fields ["sex"].Widgets [0] as PdfRadioButtonWidget).Checked = true;
(document.Form.Fields ["firstcar"] as PdfComboBoxField).SelectedIndex = 0;
(document.Form.Fields ["secondcar"] as PdfListBoxField).SelectedIndex = 1;
(document.Form.Fields ["agree"] as PdfCheckBoxField).Checked = true;
document.Save("form_filled.pdf");
PdfFixedDocument document = new PdfFixedDocument("form.pdf");
(document.Form.Fields ["firstname"] as PdfTextBoxField).Text = "John";
(document.Form.Fields ["lastname"] as PdfTextBoxField).Value = "Doe";
(document.Form.Fields ["sex"].Widgets [0] as PdfRadioButtonWidget).Checked = true;
(document.Form.Fields ["firstcar"] as PdfComboBoxField).SelectedIndex = 0;
(document.Form.Fields ["secondcar"] as PdfListBoxField).SelectedIndex = 1;
(document.Form.Fields ["agree"] as PdfCheckBoxField).Checked = true;
document.Save("form_filled.pdf");
Dim document As New PdfFixedDocument("form.pdf")
TryCast(document.Form.Fields ("firstname"), PdfTextBoxField).Text = "John"
TryCast(document.Form.Fields ("lastname"), PdfTextBoxField).Value = "Doe"
TryCast(document.Form.Fields ("sex").Widgets (0), PdfRadioButtonWidget).Checked = True
TryCast(document.Form.Fields ("firstcar"), PdfComboBoxField).SelectedIndex = 0
TryCast(document.Form.Fields ("secondcar"), PdfListBoxField).SelectedIndex = 1
TryCast(document.Form.Fields ("agree"), PdfCheckBoxField).Checked = True
document.Save("form_filled.pdf")
VB   C#

Using IronPDF

Let's look at how we can create fillable PDFs using the IronPDF C# library.

// PM> Install-Package IronPdf
using IronPdf;

// Step 1.  Creating a PDF with editable forms from HTML using form and input tags

var FormHtml = @"
<html>
    <body>
        <h2>Editable PDF  Form</h2>
        <form>
          First name:<br> <input type='text' name='firstname' value=''   > <br>
          Last name:<br> <input type='text' name='lastname'  value='' >
        </form>
    </body>
</html>";

IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("BasicForm.pdf");

// Step 2. Reading and Writing PDF form values.
var FormDocument = PdfDocument.FromFile("BasicForm.pdf");

//Set and Read the value of the "firstname" field
var FirstNameField =  FormDocument.Form.GetFieldByName("firstname");
FirstNameField.Value = "Minnie";
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value);

//Set and Read the value of the "lastname" field
IronPdf.Forms.FormField LastNameField = FormDocument.Form.GetFieldByName("lastname");
LastNameField.Value = "Mouse";
Console.WriteLine("LastNameField value: {0}", LastNameField.Value);

FormDocument.SaveAs("FilledForm.pdf");
// PM> Install-Package IronPdf
using IronPdf;

// Step 1.  Creating a PDF with editable forms from HTML using form and input tags

var FormHtml = @"
<html>
    <body>
        <h2>Editable PDF  Form</h2>
        <form>
          First name:<br> <input type='text' name='firstname' value=''   > <br>
          Last name:<br> <input type='text' name='lastname'  value='' >
        </form>
    </body>
</html>";

IronPdf.ChromePdfRenderer Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("BasicForm.pdf");

// Step 2. Reading and Writing PDF form values.
var FormDocument = PdfDocument.FromFile("BasicForm.pdf");

//Set and Read the value of the "firstname" field
var FirstNameField =  FormDocument.Form.GetFieldByName("firstname");
FirstNameField.Value = "Minnie";
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value);

//Set and Read the value of the "lastname" field
IronPdf.Forms.FormField LastNameField = FormDocument.Form.GetFieldByName("lastname");
LastNameField.Value = "Mouse";
Console.WriteLine("LastNameField value: {0}", LastNameField.Value);

FormDocument.SaveAs("FilledForm.pdf");
' PM> Install-Package IronPdf
Imports IronPdf

' Step 1.  Creating a PDF with editable forms from HTML using form and input tags

Private FormHtml = "
<html>
    <body>
        <h2>Editable PDF  Form</h2>
        <form>
          First name:<br> <input type='text' name='firstname' value=''   > <br>
          Last name:<br> <input type='text' name='lastname'  value='' >
        </form>
    </body>
</html>"

Private Renderer As New IronPdf.ChromePdfRenderer()
Renderer.RenderingOptions.CreatePdfFormsFromHtml = True
Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("BasicForm.pdf")

' Step 2. Reading and Writing PDF form values.
Dim FormDocument = PdfDocument.FromFile("BasicForm.pdf")

'Set and Read the value of the "firstname" field
Dim FirstNameField = FormDocument.Form.GetFieldByName("firstname")
FirstNameField.Value = "Minnie"
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value)

'Set and Read the value of the "lastname" field
Dim LastNameField As IronPdf.Forms.FormField = FormDocument.Form.GetFieldByName("lastname")
LastNameField.Value = "Mouse"
Console.WriteLine("LastNameField value: {0}", LastNameField.Value)

FormDocument.SaveAs("FilledForm.pdf")
VB   C#

We begin by creating a form with HTML formatting tags in the following code. After that, we save it as a PDF document. We begin reading and writing PDF form values in Step #2. With the field name, you can get to the form field. The GetFieldByName function is available in IronPDF. The selected field's value is then set, and the newly-filled form is saved.

Digital signing of PDF files

In the modern era, many people are working remotely. Filling and signing forms, sending files, and processing documents are just some of the principal activities businesses need to complete on a daily basis. One such principal activity is the signing of PDF documents, PDF portfolios, and PDF forms as alternatives to paper documents. Digital signatures have become essential as companies seek ways to sign agreements and contracts, as well as share PDF forms online.

Using XFINIUM.PDF

A signature field in a PDF file is used to apply a digital signature (PdfSignatureField class). Although the signature field is a form field that appears on one of the document's pages, the digital signature is used to sign the entire document, not just that page.

The signing process begins with a PdfDigitalSignature object being used to set the signature attribute of a signature field. Because the signature is based on the actual binary layout of the PDF file, it is formed when the document is saved.

The PdfDigitalSignature class is the foundation for all XFINIUM digital signatures.

There are several signature classes to choose from:

  • PdfCmsDigitalSignature – a digital signature based on CMS standard (inherits from PdfDigitalSignature)
  • PdfPadesDigitalSignature – a digital signature that implements the PADES standard (inherits from PdfCmsDigitalSignature)
  • PdfInteractiveCmsDigitalSignature – a digital signature based on CMS standards that can use a hardware signature smartcard for creating the digital signature (inherits from PdfDigitalSignature)
  • PdfInteractivePadesDigitalSignature – a digital signature that implements the PADES standard and that can use a hardware signature smartcard for creating the digital signature (inherits from PdfInteractiveCmsDigitalSignature)
  • PdfDocumentTimeStamp – a document level timestamp (inherits from PdfDigitalSignature)

Using IronPDF

Developers frequently inquire about utilizing IronPDF and C# to programmatically add a signature to a PDF. This can mean a variety of things to developers:

  • From an image file, add a graphical digital signature image to existing PDF files.
  • To confirm that a PDF has not been tampered with by cryptographically signing it.
  • To add a human handwritten signature icon to a PDF that has been cryptographically signed.

The first approach involves stamping a signature PNG into a PDF page that already exists. It can be used as a signature or a company stamp. Opacity is encouraged. Only a few lines of code are required to complete the procedure.

// open an existing PDF document or create a new one
PdfDocument Pdf = PdfDocument.FromFile(@"C:\Path\To\ASPX to PDF.pdf");
var SignatureStamp = new HtmlStamp() { Html = "<img src='signature.png' />", Width = 150, Height = 50, Bottom = 300, Left=85, ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent };
Pdf.StampHTML(SignatureStamp,1);
Pdf.SaveAs(@"C:\Path\To\ASPX to PDF.pdf");
// open an existing PDF document or create a new one
PdfDocument Pdf = PdfDocument.FromFile(@"C:\Path\To\ASPX to PDF.pdf");
var SignatureStamp = new HtmlStamp() { Html = "<img src='signature.png' />", Width = 150, Height = 50, Bottom = 300, Left=85, ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent };
Pdf.StampHTML(SignatureStamp,1);
Pdf.SaveAs(@"C:\Path\To\ASPX to PDF.pdf");
' open an existing PDF document or create a new one
Dim Pdf As PdfDocument = PdfDocument.FromFile("C:\Path\To\ASPX to PDF.pdf")
Dim SignatureStamp = New HtmlStamp() With {
	.Html = "<img src='signature.png' />",
	.Width = 150,
	.Height = 50,
	.Bottom = 300,
	.Left=85,
	.ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent
}
Pdf.StampHTML(SignatureStamp,1)
Pdf.SaveAs("C:\Path\To\ASPX to PDF.pdf")
VB   C#

The following code cryptographically signs a PDF using a .pfx and .p12 X509Certificate2 digital certificate which can be created easily with just one line of code.

// 123456 below represents the signature password
new IronPdf.PdfSignature("CertificateFile.p12", "123456").SignPdfFile("ASPX to PDF.pdf");
// 123456 below represents the signature password
new IronPdf.PdfSignature("CertificateFile.p12", "123456").SignPdfFile("ASPX to PDF.pdf");
' 123456 below represents the signature password
Call (New IronPdf.PdfSignature("CertificateFile.p12", "123456")).SignPdfFile("ASPX to PDF.pdf")
VB   C#

This more advanced example allows the .pfx / .p12 X509Certificate2 digital id signing method to be combined with a scan of a handwritten sign.

var Signature = new IronPdf.PdfSignature("Iron.pfx", "123456");
PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048-bit digital security</h1>");
// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";
Signature.LoadSignatureImageFromFile("handwriting.png");
doc.SignPdfWithDigitalSignature(Signature);
doc.SaveAs("ASPX to PDF.pdf");
var Signature = new IronPdf.PdfSignature("Iron.pfx", "123456");
PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048-bit digital security</h1>");
// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";
Signature.LoadSignatureImageFromFile("handwriting.png");
doc.SignPdfWithDigitalSignature(Signature);
doc.SaveAs("ASPX to PDF.pdf");
Dim Signature = New IronPdf.PdfSignature("Iron.pfx", "123456")
Dim doc As PdfDocument = Renderer.RenderHtmlAsPdf("<h1>Testing 2048-bit digital security</h1>")
' Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com"
Signature.SigningLocation = "Chicago, USA"
Signature.SigningReason = "To show how to sign a PDF"
Signature.LoadSignatureImageFromFile("handwriting.png")
doc.SignPdfWithDigitalSignature(Signature)
doc.SaveAs("ASPX to PDF.pdf")
VB   C#

Pricing and Licensing

XFINIUM.PDF Pricing and Licensing

Each package is available in two editions: the Generator Edition, which provides PDF production and editing features, and the Viewer Edition, which contains all of the functionality of the Generator Edition, plus PDF rendering and PDF viewing.

  • Each developer has their own license for the Xfinium PDF library. Each developer that produces code for XFINIUM needs a license for this library of PDF files.
  • XFINIUM.PDF can be sent royalty-free to an unlimited number of desktop PCs and servers as part of your license.
  • A year's "Assistance Subscription" offers a year's worth of free upgrades as well as technical support.

The pricing ranges from $290.00 to $872.00 per year depending on the respective package.

IronPDF Pricing and Licensing

IronPDF, on the other hand, is a C# PDF library. It is free to use for development and can be licensed for commercial use at any time. Single-project licenses, single developers, agencies, and multinational organizations, as well as SaaS and OEM redistribution, are all accessible. All licenses come with a 30-day money-back guarantee, a year of software support and upgrades, dev/staging/production validity, and a perpetual license (one-time purchase). The Lite package is available for $749. There are no recurring expenses with IronPDF products.

Conclusion

The Iron PDF library makes it easier to create PDF documents because it does not rely on proprietary APIs. "HTML-To-PDF" converts open standard document types such as HTML, JS, CSS, JPG, PNG, GIF, and SVG into pixel-perfect PDFs. In other words, it builds on the talents that developers currently have. It allows users to download documents, email them, or save them to the cloud, and make bills, quotes, reports, contracts, and other paperwork. It works with ASP.NET, ASP.NET Core, web forms, MVC, .NET Framework, and .NET Core Web APIs.

The XFINIUM.PDF library has a wide range of functionality for both novices and advanced PDF developers. Whether you need to make a simple report, fill out a PDF form, construct a PDF portfolio, redact sensitive information from a PDF file, or convert a PDF file to a multipage TIFF image, it has the tools you need. You have complete control over the PDF files generated because the basic object model adheres to the PDF specification. XFINIUM.PDF code can be compiled on all supported platforms without modification. The XFINIUM.PDF collection is available to assist you.

XFINIUM.PDF licenses come in two editions, the Generator and the Viewer, which start at $290 and $387 respectively. This is somewhat cheaper than IronPDF, which has a light version starting at $749. IronPDF is worth going for because it offers both single and multi-user licenses, while XFINIUM.PDF offers only a single-user license — meaning that you will need a license for every developer. On the other hand, IronPDF offers a professional license starting at $799 which can be used by an unlimited number of users.

With IronPDF, you can manipulate PDF files more easily than with XFINIUM.PDF. IronPDF uses fewer lines of code for complicated manipulations, which helps to ease the workload of the programmer.

The Iron Software company also offers all its customers the option to acquire the whole suite of packages with just two clicks. This means that for the price of just two libraries in the Iron Software suite, you can currently get all five libraries, along with uninterrupted support for all of them.

< PREVIOUS
A Comparison between IronPDF and SautinSoft PDF Focus
NEXT >
A Comparison between IronPDF & GrapeCity PDF Viewer

Ready to get started? Version: 2024.12 just released

Free NuGet Download Total downloads: 11,622,374 View Licenses >