Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
Choosing the right PDF library that fits your needs best can be a daunting task with the ever growing number of tools on the internet for working with PDFs (Portable Document Format). So today let us help you out, by taking a closer look at two different PDF tools, IronPDF and QuestPDF.
IronPDF is a comprehensive .NET library known for its versatility in creating, editing, and processing PDF documents. With a wide range of features, including HTML to PDF conversion, document security, interactive forms, and more, IronPDF will be an invaluable addition to your developer's toolkit.
QuestPDF is an open-source .NET library focused on providing an easy-to-use, code-only approach to PDF generation. QuestPDF is ideal if you prefer a simple, streamlined, code-centric workflow without the need for proprietary scripting languages or formats.
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.
QuestPDF offers strong cross-platform compatibility, meaning no matter what platform you are working on, you will most likely be able to implement QuestPDF into your work environment.
.NET versions:
.NET Core (3.1+)
.NET Standard (2.0+)
Systems: Works on various operating systems and cloud environments such as Windows, Linux, macOS, Azure, and AWS.
IronPDF and QuestPDF offer distinct sets of features tailored to different user needs, so choosing which library would work best for you depends on what you plan to do with the PDFs you are working with. Below is a comparison of their core functionalities:
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. Are you looking to convert other file formats to PDF? IronPDF supports the conversion of many different file formats including; DOCX to PDF, RTF to PDF, Image to PDF, and more.
PDF Generation: With IronPDF, you can carry out PDF document generation from URLs, ASPX files, or HTML strings.
Watermarking: Apply text and image watermarks to PDF files.
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 a more detailed feature list of what IronPDF has to offer, visit ironpdf.com.
Design Documents Using C#: Use C# Code to design and create PDF files using a code-only approach.
Comprehensive Layout Engine: QuestPDF's comprehensive layout engine ensures that you can generate PDF documents with ease, it gives you full control over the generation process and document structure, it provides full paging support, and it optimizes the document's visual structure.
Predictable Structural Elements: Use QuestPDF to add a range of structural elements to your PDF file, including text, images, borders, and tables.
Hot-Reload Capability: You will be able to have real-time document preview without code recompilation.
Before choosing which PDF library is right for you, let's take a look at some common use cases for different uses you may have for a PDF library, comparing how IronPDF and QuestPDF handle these tasks.
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")
QuestPDF:
QuestPDF does not natively support HTML to PDF conversion, as it is designed more towards creating PDFs programmatically, rather than converting other files to a PDF format.
So, if you are looking to convert HTML content into a PDF document, then IronPDF would be the tool for you. With its built-in support, IronPDF offers you a straightforward, efficient HTML-to-PDF conversion tool.
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;
//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;
//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
'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")
QuestPDF:
With no built-in support for PDF encryption, you will find yourself turning to external libraries if you want to encrypt your PDFs. However, QuestPDF can be used to modify the PDF's metadata.
While not a part of everyone's day-to-day life, if you find yourself needing to regularly encrypt documents or edit document security settings, then having a tool with inbuilt support for this task will make your life a lot easier. IronPDF's intuitive, easy-to-learn encryption tool will help streamline your workspace. Whereas cheaper or free tools such as QuestPDFs may lack in having the same extensive range of tools.
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")
QuestPDF:
QuestPDF does not support redaction directly, instead, if you want to redact content when working with QuestPDF, you would need to use an additional library such as iTextSharp.
IronPDF will make redacting your PDF content easy, with its concise, yet effective redaction tool capable of redacting content with just a few lines of code. QuestPDF, on the other hand, cannot handle redaction tasks on its own, requiring additional libraries that do have redaction capabilities.
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")
QuestPDF:
You can not use QuestPDF to digitally sign PDFs. Instead, you could create a PDF with QuestPDF and then use an external library to digitally sign that PDF.
If you want to handle applying digital signatures to your PDF files efficiently, then IronPDF is the clear choice here, it handles digitally signing PDF files with ease. You will have full control over the process with its easy-to-use, powerful API.
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")
QuestPDF:
QuestPDF cannot be used to add watermarks to your PDF files, due to the simplistic nature of this library.
If you are familiar with HTML and CSS, then you will find IronPDF's watermark tool even easier to use than it already seems, due to its use of both HTML and CSS for styling and placement of the watermark. With IronPDF, you will be able to programmatically add custom watermarks to any PDF you are working with. However, if you are working with QuestPDF you will find it is lacking in this area, with no native built-in tool for watermark application.
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");
// 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;
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");
// 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
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")
' Create image stamper
Dim 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")
QuestPDF:
using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
using QuestPDF.Helpers;
Document.Create(container =>
{
container.Page(page =>
{
page.Size(PageSizes.A4);
page.Margin(2, Unit.Centimetre);
page.PageColor(Colors.White);
page.DefaultTextStyle(x => x.FontSize(12));
// Adding Header and Footer for context
page.Header()
.Text("Header Text")
.FontSize(20)
.Bold()
.AlignCenter();
page.Footer()
.Text("Footer Text")
.FontSize(12)
.AlignCenter();
// Adding main content and stamps
page.Content()
.Canvas(canvas =>
{
// Main content
canvas.DrawText("This is the main content of the page.", x =>
{
x.Translate(50, 50);
x.FontSize(12);
});
// Stamped text
canvas.DrawText("Stamped Text", x =>
{
x.Translate(200, 200); // Position the text
x.FontSize(30);
x.Bold();
x.FontColor(Colors.Red);
});
// Stamped image
canvas.DrawImage("path/to/image.png", x =>
{
x.Translate(200, 300); // Position the image
x.Width(100); // Set the width of the image
});
});
});
}).GeneratePdf("output.pdf");
using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
using QuestPDF.Helpers;
Document.Create(container =>
{
container.Page(page =>
{
page.Size(PageSizes.A4);
page.Margin(2, Unit.Centimetre);
page.PageColor(Colors.White);
page.DefaultTextStyle(x => x.FontSize(12));
// Adding Header and Footer for context
page.Header()
.Text("Header Text")
.FontSize(20)
.Bold()
.AlignCenter();
page.Footer()
.Text("Footer Text")
.FontSize(12)
.AlignCenter();
// Adding main content and stamps
page.Content()
.Canvas(canvas =>
{
// Main content
canvas.DrawText("This is the main content of the page.", x =>
{
x.Translate(50, 50);
x.FontSize(12);
});
// Stamped text
canvas.DrawText("Stamped Text", x =>
{
x.Translate(200, 200); // Position the text
x.FontSize(30);
x.Bold();
x.FontColor(Colors.Red);
});
// Stamped image
canvas.DrawImage("path/to/image.png", x =>
{
x.Translate(200, 300); // Position the image
x.Width(100); // Set the width of the image
});
});
});
}).GeneratePdf("output.pdf");
Imports QuestPDF.Fluent
Imports QuestPDF.Infrastructure
Imports QuestPDF.Helpers
Document.Create(Sub(container)
container.Page(Sub(page)
page.Size(PageSizes.A4)
page.Margin(2, Unit.Centimetre)
page.PageColor(Colors.White)
page.DefaultTextStyle(Function(x) x.FontSize(12))
' Adding Header and Footer for context
page.Header().Text("Header Text").FontSize(20).Bold().AlignCenter()
page.Footer().Text("Footer Text").FontSize(12).AlignCenter()
' Adding main content and stamps
page.Content().Canvas(Sub(canvas)
' Main content
canvas.DrawText("This is the main content of the page.", Sub(x)
x.Translate(50, 50)
x.FontSize(12)
End Sub)
' Stamped text
canvas.DrawText("Stamped Text", Sub(x)
x.Translate(200, 200) ' Position the text
x.FontSize(30)
x.Bold()
x.FontColor(Colors.Red)
End Sub)
' Stamped image
canvas.DrawImage("path/to/image.png", Sub(x)
x.Translate(200, 300) ' Position the image
x.Width(100) ' Set the width of the image
End Sub)
End Sub)
End Sub)
End Sub).GeneratePdf("output.pdf")
While both IronPDF and QuestPDF do support stamping text and images onto your PDF pages, as you can see in the above examples IronPDF does offer a more concise and easy-to-use method of carrying out this task. With IronPDF, you will be able to achieve the end result with less work than QuestPDF may require. QuestPDF takes a longer, and more manual approach to this task.
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")
QuestPDF:
QuestPDF does not support DOCX to PDF conversion directly, if you want to convert a DOCX file to PDF when working with QuestPDF, then you would need to install an additional library such as Aspose.Words or Syncfusion.
IronPDF is an all round champion when it comes to handling file conversion, with the built-in ability to convert many different document types to PDF, including DOCX, as seen here. Whereas, QuestPDF yet again needs an additional library to carry out this task.
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.
Community: QuestPDF is open-source and available under the MIT license, and its community license is free. Using this license allows you to freely modify, and distribute your projects using this software as per its licensing model.
Professional: At $699, you can purchase the professional license which covers teams of up to 10 developers working on projects using QuestPDF.
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 IronSoftware YouTube channel.
Documentation: QuestPDF offers extensive documentation on their website, as well as quick get-started guides and code examples.
Community: As QuestPDF is an open-sourced project, it often relies on the community to be promoted and to find bugs. This means it encourages an active and supportive community of developers who use QuestPDF
QuestPDF relies on community contributions for documentation and support, which might not be as extensive or structured compared to IronPDF's offerings.
IronPDF and QuestPDF both offer valuable tools for PDF generation in .NET, catering to different development needs. So, choosing which one is best for you really comes down to your needs and your budget. QuestPDF, being open-source and simple to use, is suitable for developers seeking a code-centric, lightweight solution. If you don't need all the extra features that IronPDF has to offer, and just want a free, simple PDF library then QuestPDF may be the right fit for you
IronPDF stands out with its comprehensive feature set, extensive documentation, and robust support, making it an ideal choice for enterprise-level applications. With IronPDF in your developer's toolkit, no PDF-related task is too big, and there's less chance of needing to install additional libraries when handling more complex PDF tasks.
9 .NET API products for your office documents