Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
Working with PDF (Portable Document Format) files can be an integral part of your working environment, from generating invoices to creating documentation for your products, there's a good chance that at some point in your life, you'll find yourself working with PDF's.
However, in today's technologically driven world, there is an endless range of PDF tools so how to know which one is best for you? Today we will be looking at two PDF tools, PdfPig and IronPDF, taking a comparative look at their features, support, and licensing models.
IronPDF is a robust .NET PDF library that can be implemented to generate, manipulate, and work with PDFs in various settings. Whether you want to create PDF documents from HTML content, apply watermarks to existing PDF files, have full control over the security settings for your PDF files, or even save PDF files as images, IronPDF has you covered. With extensive documentation and a strong support team, IronPDF ensures that you will have access to all the resources they need to succeed.
PdfPig is an open-source Apache 2.0 licensed library that allows users to read and create PDFs in C#, F#, and other .NET languages. With PdfPig, you can create simple PDF documents, read PDF files, extract content from PDF files, and more. While it may not match IronPDF's wide range of features and documentation, PdfPig can still be a strong contender, offering you a simpler approach to working with PDF files.
In this first section, we will looking at an overview of the cross-platform support each of the libraries currently offers. This is an essential first step into today's comparison, as you will first need to know if a tool we are looking at would even work within your work environment before we can start looking at features and their use cases.
IronPDF supports a wide range of platforms, ensuring that you can work in your preferred environment. Here’s a breakdown of its compatibility:
.NET versions:
(C#, VB.NET, F#)
.NET Core (8, 7, 6, 5, and 3.1+)
.NET Standard (2.0+)
App environments: IronPDF works in app environments including Windows, Linux, Mac, Docker, Azure, and AWS
IDEs: Works with IDEs such as Microsoft Visual Studio and JetBrains Rider & ReSharper
For more information, visit IronPDF Compatibility.
.NET Versions
.NET Standard (2.0+)
.NET Core (2.0+)
Both IronPDF and PdfPig offer a range of features for handling PDF documents. Here’s a comparison of their key functionalities:
HTML to PDF conversion: IronPDF can handle HTML to PDF conversion, with its full support for modern web standards, you can be assured that IronPDF will consistently return pixel-perfect PDFs from your HTML content.
PDF file conversion: Need to convert file formats other than HTML to PDF? IronPDF supports the conversion of many different file formats including; DOCX to PDF, RTF to PDF, Image to PDF, URL to PDF, and even PDF to HTML, all while maintaining the desired document structure.
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.
For detailed feature information about the features offered by IronPDF, visit IronPDF Features.
Extract content: With PdfPig, you can extract text from your PDFs.
Read PDF data: PdfPig supports the ability to read PDF annotations, forms, and embedded documents. In addition to this, you can use PdfPig to gain access to the PDF metadata.
HTML to PDF conversion is a simple enough task, yet it can be helpful depending on your needs. Whether you want to create a PDF file documenting a website from your portfolio or need to create PDFs from HTML content for your work environment, you'll need a strong HTML to PDF convertor so you can consistently produce high-quality PDFs.
IronPDF Code Example:
using IronPdf;
// Disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;
// Instantiate Renderer
var renderer = new ChromePdfRenderer();
// Create a PDF from an HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
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 an HTML string using C#
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: images, CSS and JavaScript.
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 an HTML string using C#
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")
pdf.SaveAs("output.pdf")
' Advanced Example with HTML Assets
' Load external html assets: images, CSS and JavaScript.
Dim myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")
PdfPig Code Example:
PdfPig in itself does not support HTML to PDF conversion, requiring you to use a third-party library to handle the conversion. PdfPig is more geared towards handling PDF creation over PDF conversion. So if you're looking for a library with built-in conversion support, IronPDF would be the way to go here.
When you want to convert HTML content or web pages to a PDF format, IronPDF offers a strong, concise tool for handling this task, whereas PdfPig has no such inbuilt tool and relies on outside libraries.
When you are dealing with any sensitive or private PDF files, you will be looking for a PDF tool that can handle security tasks such as encrypting the PDF file, editing the document metadata, and adding a password. Let's now take a look at how these tools would approach this scenario.
IronPDF Code Example:
using IronPdf;
using System;
//Open an Encrypted File, alternatively create a new PDF from Html
var pdf = PdfDocument.FromFile("encrypted.pdf", "password");
//Edit 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 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 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")
PdfPig Code Example:
PdfPig does not offer the same in-built support for PDF security that IronPDF does. Due to the more simplistic nature of this library, you would need an external PDF library that does offer these features to handle this task.
When dealing with sensitive PDF files, IronPDF offers comprehensive security features like encryption, metadata editing, and password protection, while PdfPig lacks built-in security support and requires an additional library for such tasks.
What if you want to redact certain words or sections of content from your PDF files? This is another common need when working with a PDF file, so let us see if these PDF libraries are up to the task.
IronPDF Code Example:
using IronPdf;
PdfDocument document = PdfDocument.FromFile("novel.pdf");
// Redact 'are' phrase from all pages
document.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
using IronPdf;
PdfDocument document = PdfDocument.FromFile("novel.pdf");
// Redact 'are' phrase from all pages
document.RedactTextOnAllPages("are");
pdf.SaveAs("redacted.pdf");
Imports IronPdf
Private document As PdfDocument = PdfDocument.FromFile("novel.pdf")
' Redact 'are' phrase from all pages
document.RedactTextOnAllPages("are")
pdf.SaveAs("redacted.pdf")
PdfPig Code Example:
PdfPig does not offer any support for redacting content from PDF files.
IronPDF offers a simple way of redacting content from your PDF files, requiring only a few lines of code. This means you can easily automate any redaction tasks, raising the efficiency of your workplace. PdfPig, on the other hand, offers no such support for this task.
While this is less likely to be an essential part of your daily PDF manipulation needs, depending on your work environment you may come across times when you might need to digitally sign your PDF files, so now we will look at how these two tools might handle that.
IronPDF Code 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")
PdfPig Code Example:
PdfPig does not directly support digital signing, you will need to use other libraries or tools to do this.
If you're looking for a tool to make signing PDFs a breeze, IronPDF's straightforward method will help not only raise the efficiency with which you carry out this task but also give you full control over the process. PdfPig, however, does not offer any support for digitally signing PDF files.
Are you working with sensitive documents or looking to protect your work and avoid others stealing it to claim as their own? Then applying custom watermarks to your PDF pages can be just what you need. Let's see how the libraries tackle this task.
IronPDF Code 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")
PdfPig Code Example:
PdfPig does not directly support watermarking.
While PdfPig doesn't support adding watermarks to your PDFs, IronPDF does. Taking advantage of its inbuilt support for applying watermarks, you can have full control over the entire process, and if you are familiar with HTML and CSS then it will be even easier to pick up thanks to the fact that it uses HTML/CSS to apply the watermarks.
Stamping images and text onto your PDF files is much the same as applying watermarks in a sense, and could be used for similar reasons, but can these two libraries carry out this task?
IronPDF Code Example:
using IronPdf;
using IronPdf.Editing;
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;
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
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")
PdfPig Code Example:
PdfPig, on its own, does not support stamping PDF image objects or text onto PDF files. If you wanted to stamp text and images onto your PDF document, you would have to use additional libraries.
If you are looking for a tool that can handle stamping text and images onto your PDFs then IronPDF would be the tool for you. With its powerful inbuilt stamping tool, you would have full control over the entire process and be able to stamp anything you need to stamp onto your files. If you want to add different fonts to the text stamper, IronPDF supports truetype format fonts. PdfPig does not offer the same support, making it unable to carry out this task.
Another common conversion task other than converting HTML to PDF is converting DOCX files to a PDF format. So if this is something that you come across in your day-to-day tasks, or even just once in a while, having a tool that can easily handle this task can make a huge difference in your workplace efficiency.
IronPDF Code 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")
PdfPig Code Example:
PdfPig does not support DOCX to PDF conversion. Again, as we saw with the HTML to PDF conversion, instead of supporting conversion tasks PdfPig focuses more on PDF creation from scratch.
With IronPDF, DOCX to PDF conversion is a breeze. With this tool, you can convert any DOCX file to PDF in just a few lines, making it a concise, straightforward yet powerful tool. PdfPig, on the other hand, cannot handle DOCX to PDF conversion.
For more examples, visit IronPDF Code Examples.
IronPDF has different levels and additional features for purchasing a license. Developers can also buy IronSuite which, gives you access to all of IronSoftware’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.
PdfPig is licensed under the Apache License 2.0. This means that the PdfPig library is free to use, as long as you follow the guidelines of the terms for this licensing. Although it is free, therefore making PdfPig cheaper to use than IronPDF, it lacks in areas such as features and support when compared to the more costly libraries such as IronPDF.
IronPDF provides robust documentation and support options to ensure developers can make the most of the library:
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 IronSoftware YouTube channel.
GitHub Wiki: The PdfPig GitHub includes a wiki that details the features PdfPig has to offer, as well as how to use them.
Issue reporting: When using PdfPig, if you were to come across any issues, you can easily file an issue report on their GitHub.
When it comes down to it, choosing the right PDF library for you depends on the tasks you are needing to carry out and your budget. If you're looking for a more budget-friendly option and only really need to be able to do basic tasks such as PDF document creation, reading PDF documents, and extracting content from them, then PdfPig may be better suited for you.
However, if you are looking at doing my complex tasks and want the ease of having all the tools for the job in one place, then IronPDF is the best option for you, with its robust, rich set of features, extensive documentation and easily access support, IronPDF could be a powerful addition to your workspace.
You can try the 30-day free trial to check out their available features.
9 .NET API products for your office documents