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
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, visit IronPDF's Feature Page.
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.
HTML to PDF Conversion with IronPDF:
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.
For HTML content conversion into a PDF document, IronPDF's HTML-to-PDF Tool is recommended, offering a straightforward, efficient solution.
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");
IRON VB CONVERTER ERROR developers@ironsoftware.com
QuestPDF:
Without built-in support for PDF encryption, QuestPDF users will turn to external libraries if encryption is necessary. However, QuestPDF can modify the PDF's metadata.
If document encryption or security settings adjustments are routine, IronPDF, with its intuitive encryption tool, is preferred over tools like QuestPDF that lack extensive features without additional libraries.
Redacting Content with IronPDF:
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.
With IronPDF, redacting content is made simple and efficient, while QuestPDF requires complementary libraries for redaction tasks.
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:
QuestPDF cannot be used to digitally sign PDFs. Instead, you could create a PDF with QuestPDF and then use an external library to digitally sign that PDF.
For streamlined digital signatures, IronPDF's Signing Feature offers full control and ease of use, unlike QuestPDF.
Watermark Application with IronPDF:
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.
Leverage IronPDF's HTML/CSS capabilities for custom watermarks, contrasting QuestPDF's lack of native watermark support.
IronPDF Text and Image Stamping:
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")
Both IronPDF and QuestPDF support text and image stamping, but IronPDF's concise method is more straightforward compared to QuestPDF's lengthy approach.
DOCX to PDF Conversion with IronPDF:
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. To convert a DOCX file to PDF with QuestPDF, additional libraries like Aspose.Words or Syncfusion are needed.
Opt for IronPDF, with built-in DOCX conversion, over QuestPDF, which lacks this capability natively.
View IronPDF Licensing Options for different levels and additional features. Developers can also purchase IronSuite Access, which includes all IronSoftware products for the price of two. IronPDF also provides a free trial for 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 next step up from the lite license costs $1,499. The Plus license offers chat support and phone support in addition to basic email support.
Professional License: 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 offers royalty-free redistribution coverage for an extra $1,999.
Uninterrupted Product Support: Offers 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, the professional license 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 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 an open-sourced project, QuestPDF heavily relies on community contributions for promotion and bug-finding, encouraging an active and supportive developer community.
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. Choosing the best fit depends on your needs and 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 extra features that IronPDF offers 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, no PDF-related task is too big, and there's less chance of needing to install additional libraries for handling complex PDF tasks.
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.
You can try the 30-day free trial to check out their available features.
9 .NET API products for your office documents