Wkhtmltopdf C# Comparison with Code Examples
IronPDF vs wkhtmltopdf
Feature-by-feature comparison with evidence from official docs, NuGet listings, and project repositories
| Feature | wkhtmltopdf | IronPDF ✦ |
|---|---|---|
| PDF Creation & Conversion | ||
| HTML/CSS to PDF |
⚠ Outdated Engine
Core purpose is HTML→PDF, but engine is Qt WebKit (outdated). Lacks modern CSS3, Flexbox, and
Grid support.
|
✓ Yes
Embedded Chromium engine — pixel-perfect HTML5/CSS3 with Flexbox, Grid, and modern web
standards.
|
| JavaScript Execution |
~ Partial
Supports JS-related options, but the aging WebKit engine recommends alternatives for complex
JS.
|
✓ Yes
Full HTML/CSS/JavaScript rendering via embedded Chromium — dynamic charts, SPAs, interactive
content.
|
| Programmatic Generation |
✕ No
Designed to render HTML to PDF only — not a general programmatic PDF drawing library.
|
✓ Yes
Create new/blank PDFs via
PdfDocument constructor. Full programmatic control.
|
| Merge, Split & Rearrange |
✕ No
Conversion tool only; no evidence of PDF page split/merge APIs.
|
✓ Yes
Merge/split supported with dedicated how-to guidance. One-line operations.
|
| Editing & Manipulation | ||
| Headers, Footers & Page Numbers |
✓ Yes
Engine provides header/footer features (common wkhtmltopdf capability via CLI flags).
|
✓ Yes
Dedicated header/footer API + page placeholders supported. HTML-based with full
customization.
|
| Watermarks & Stamps |
✕ No
Not a PDF editor; watermarking is typically done by changing the HTML template before
conversion.
|
✓ Yes
Watermark/stamping how-tos with HTML/text/image stampers. Full opacity, rotation, position
control.
|
| Reading & Extraction | ||
| Extract Text from PDFs |
✕ No
Converter only; not a text-extraction library.
|
✓ Yes
ExtractAllText supports ordering options (e.g., visual order). |
| Render Pages to Images |
✕ No
wkhtmltopdf converts HTML→PDF; wkhtmltoimage is HTML→image, not PDF→image.
|
✓ Yes
PDF-to-image/rasterization APIs documented. Native PNG, JPEG, BMP output.
|
| OCR for Scanned PDFs |
✕ No
OCR not in scope of HTML→PDF converter.
|
✓ Via IronOCR
Create searchable PDFs using OCR. 127+ language support via IronOCR integration.
|
| Security & Compliance | ||
| Digital Signatures |
✕ No
wkhtmltopdf does not implement PDF signing.
|
✓ Yes
Dedicated signing guide with X509/PFX certificate support.
|
| PDF/A Compliance |
✕ No
PDF/A conformance workflows are not documented as supported output.
|
✓ Yes
PDF/A conversion guidance (e.g., PDF/A-3B details). Enterprise compliance ready.
|
| Platform & Deployment | ||
| Cross-Platform Support |
⚙ Wrapper-Dependent
Cross-platform depends on having correct native binaries installed for each OS. Not
self-contained.
|
✓ Yes
OS-specific NuGet packages + macOS & Linux guides. Windows, Linux, macOS, ARM supported.
|
| Server / Docker Deployment |
⚙ Wrapper-Dependent
Requires shipping native binaries; project notes legacy engine status. Complex Docker setup.
|
✓ Yes
Official Azure Functions + Docker guides; optional separate engine container.
|
| Time-to-First-PDF |
~ Complex
Requires native binary management + wrapper integration. Not a simple NuGet install.
|
✓ Simple
Quickstart shows install + minimal code for HTML→PDF. Single
Install-Package IronPdf.
|
| Licensing & Support | ||
| Licensing Clarity |
~ Complex
LGPLv3 licensing introduces copyleft considerations; different .NET wrappers have different
licenses.
|
✓ Clear
EULA and licensing terms publicly documented. Perpetual commercial licenses.
|
| Commercial Support / SLA |
? Unknown
Engine is OSS (archived); vendor SLA isn't described in cited sources. Community-only
support.
|
✓ 24/5 SLA
Support portal + "24/5 technical support" with guaranteed SLA — email, live chat, phone.
|
| Documentation Quality |
~ Partial
Extensive CLI docs for the engine, but .NET wrapper docs vary widely in quality.
|
✓ Extensive
Full "get-started/how-to/examples" docs with copy-paste code samples and video tutorials.
|
IronPDF is a modern, actively maintained replacement — try free for 30 days →
Choosing the right PDF library for your needs can be difficult when there are seemingly countless options. When comparing, key factors include features offered versus your requirements, the level of support and documentation, the learning curve, and licensing costs. Crucially, security implications must also be weighed.
This comparison covers two PDF generation libraries with distinct design philosophies: wkhtmltopdf and IronPDF. wkhtmltopdf built its reputation as a straightforward command-line HTML-to-PDF converter, and many teams have relied on it for exactly that purpose. However, using wkhtmltopdf in C# can introduce security risks. Since it relies on an external executable (WebKit), vulnerabilities or improper command sanitization could potentially be exploited, risking server compromise through crafted HTML or arguments.
IronPDF is a managed .NET library that runs within your application's security context, reducing the attack surfaces associated with external processes. The sections below compare their features, rendering capabilities, and security architecture.
What Are IronPDF and wkhtmltopdf?
IronPDF is a C# library for PDF creation, manipulation, and processing within the .NET framework. Its API covers HTML to PDF conversion, text and image extraction, form handling, and document security options like encryption and digital signatures — all accessible through a single NuGet package. You can install IronPDF via the NuGet Package Manager Console and get the library running in minutes. For more information, visit IronPDF's official website.
wkhtmltopdf is a .NET Core P/Invoke wrapper for the wkhtmltopdf library, a popular tool for converting HTML pages to PDF using the Qt WebKit rendering engine. This open-source library is forked from DinkToPdf and focuses on HTML to PDF conversion with an emphasis on simplicity. It's easy to install; after downloading and running the wkhtmltopdf executable, all you need to do is ensure that it is added to your system's path environment variable. wkhtmltopdf is a lightweight library, though its scope is focused on conversion rather than broader PDF manipulation. To evaluate IronPDF's security and feature differences in your own environment, a [free 30-day trial](trial-license is available.
Cross-Platform Compatibility
IronPDF
IronPDF supports a broad range of environments within the .NET framework, providing consistent operation across different platforms.
-
.NET versions:
- Fully written in and supports C#, VB.NET, and F#.
- .NET Core (8, 7, 6, 5, and 3.1+).
- .NET Standard (2.0+).
- .NET Framework (4.6.2+).
-
App environments: IronPDF works within various app environments such as Windows, Linux, Mac, Docker, Azure, and AWS.
-
IDEs: Works with IDEs such as Microsoft Visual Studio and JetBrains Rider & ReSharper.
- OS and Processors: Supports several different OS & processors including Windows, Mac, Linux, x64, x86, ARM.
For more details on IronPDF's compatibility, visit IronPDF Compatibility.
wkhtmltopdf
-
.NET versions: As a command-line tool, wkhtmltopdf itself doesn't have direct .NET support, however, .NET developers typically interact with it using a wrapper or library, such as DinkToPdf.
-
App Environments: wkhtmltopdf works smoothly within several app environments such as Windows, Linux, and macOS.
- Programming Languages: wkhtmltopdf is largely used through command-line tools or integrated with programming languages such as C#, Java, Python, PHP, and Node.js.
Installation
Installing IronPDF
To use IronPDF, install it via NuGet Package Manager in Visual Studio:
Install-Package IronPdf
Installing wkhtmltopdf
-
Download the installer:
- Go to the wkhtmltopdf download page.
- Under the "Windows" section, download the latest stable version of the installer (e.g., .exe file).
-
Run the installer:
- Double-click the downloaded .exe file.
- Follow the installation prompts.
- During installation, you may choose to add wkhtmltopdf to your system PATH to make it accessible from any command prompt.
- Verify the installation:
- Open Command Prompt (cmd).
- Type
wkhtmltopdf --versionto check if it's correctly installed. You should see the version number printed on the screen.
How Do IronPDF and wkhtmltopdf Compare on Features?
When comparing IronPDF and wkhtmltopdf, it's essential to look at the features both libraries provide for PDF generation and manipulation.
IronPDF Features:
-
PDF conversion: IronPDF converts HTML to PDF using an embedded Chromium engine with full support for HTML5, CSS3 (including Flexbox and Grid), and JavaScript. It also converts from other formats such as DOCX, images, RTF, and more.
-
PDF Generation: With IronPDF, you can generate PDFs from URLs, image formats, ASPX files, or HTML strings.
-
Security features: IronPDF includes encryption, password protection, and granular permission settings (read-only, copy/paste restriction, print control) as first-class operations in the API.
- PDF editing features: IronPDF can process existing PDF documents, edit them, and read PDF files. Editing capabilities include adding headers and footers, stamping text and images onto pages, applying custom watermarks, working with PDF forms, and splitting or merging PDF files.
For more details on IronPDF features, visit IronPDF Features.
wkhtmltopdf C# Key Features:
-
HTML to PDF Conversion: Convert HTML pages, files, strings, and CSS content to PDF, retaining the original layout.
-
Customization Options: Supports page size, margins, headers, footers, etc.
-
Open Source: Free to use under the MIT license.
- Cross-Platform Compatibility: Works on Windows, Linux, and macOS environments.
Side-by-Side Code Examples
HTML to PDF Conversion
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>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: Images, CSS and JavaScript.
// An optional BasePath 'C:\\site\\assets\\' is set as the file location to load assets from
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>");
// Export to a file or Stream
pdf.SaveAs("output.pdf");
// Advanced Example with HTML Assets
// Load external html assets: Images, CSS and JavaScript.
// An optional BasePath 'C:\\site\\assets\\' is set as the file location to load assets from
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>")
' Export to a file or Stream
pdf.SaveAs("output.pdf")
' Advanced Example with HTML Assets
' 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 myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")
wkhtmltopdf (Using DinkToPdf):
using DinkToPdf;
var converter = new BasicConverter(new PdfTools());
var doc = new HtmlToPdfDocument()
{
Objects = { new ObjectSettings() { HtmlContent = "<h1>Hello World</h1>" } }
};
byte[] pdf = converter.Convert(doc);
System.IO.File.WriteAllBytes("HtmlToPdf.pdf", pdf);
using DinkToPdf;
var converter = new BasicConverter(new PdfTools());
var doc = new HtmlToPdfDocument()
{
Objects = { new ObjectSettings() { HtmlContent = "<h1>Hello World</h1>" } }
};
byte[] pdf = converter.Convert(doc);
System.IO.File.WriteAllBytes("HtmlToPdf.pdf", pdf);
Imports DinkToPdf
Private converter = New BasicConverter(New PdfTools())
Private doc = New HtmlToPdfDocument() With {
.Objects = {
New ObjectSettings() With {.HtmlContent = "<h1>Hello World</h1>"}
}
}
Private pdf() As Byte = converter.Convert(doc)
System.IO.File.WriteAllBytes("HtmlToPdf.pdf", pdf)
wkhtmltopdf (Using command line)
wkhtmltopdf myfile.html myfile.pdf
wkhtmltopdf myfile.html myfile.pdf
IronPDF produces pixel-perfect PDF files from HTML content in a few lines of code. Its embedded Chromium engine supports modern CSS3, Flexbox, and Grid, so the rendered PDF closely matches the original source. wkhtmltopdf is built around the same core task — HTML to PDF conversion — and handles it concisely whether invoked through a wrapper library or the command line. Where teams typically encounter friction is with modern CSS layouts: wkhtmltopdf's Qt WebKit engine does not fully support Flexbox or Grid, which can produce unexpected rendering results on contemporary designs.
Encrypting PDF Files
IronPDF:
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;
// 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 file 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 file 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")
wkhtmltopdf:
Encryption is outside wkhtmltopdf's current scope; achieving it requires a separate third-party library.
IronPDF provides a direct API for encrypting PDF files, including password protection, read-only enforcement, and granular permission control. wkhtmltopdf focuses on the conversion step, so teams needing encryption typically integrate a second library to handle document security after the PDF is generated.
Redacting PDF Content
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")
wkhtmltopdf:
Redaction is not part of wkhtmltopdf's feature set.
IronPDF's redaction API redacts specified content in a single method call — three lines of code in the example above. Because wkhtmltopdf is designed as a conversion tool rather than a PDF editor, redaction falls outside its architectural scope. Teams needing this capability would add a separate PDF manipulation library.
Digitally Signing PDF Files
IronPDF:
using IronPdf;
using IronPdf.Signing;
using System.Security.Cryptography.X509Certificates;
// Instantiate Renderer
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;
// Instantiate Renderer
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
' Instantiate Renderer
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")
wkhtmltopdf C#:
wkhtmltopdf is not designed to sign PDFs; a separate library is needed for this capability.
IronPDF's digital signing API accepts X509/PFX certificates and signs a document in two method calls, which streamlines workflows that require programmatic signing at scale. wkhtmltopdf is not designed to handle PDF signing on its own; however, if you are using it alongside another library, that library may provide the signing capabilities you need.
Applying Custom Watermarks to your PDF
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")
wkhtmltopdf:
Watermarking is not part of wkhtmltopdf's native feature set. Instead, you would need to implement CSS styling in the source HTML before conversion, or use a separate PDF library that can apply watermarks to existing documents.
IronPDF's watermarking tool uses an HTML/CSS-based approach, giving developers control over opacity, rotation, and position without leaving the .NET API. wkhtmltopdf can approximate watermarks through CSS styling applied to the source HTML before conversion — an approach that works for simpler cases but reaches its design boundary when you need to watermark existing PDFs that were not generated from your own HTML.
Stamping Images and Text
IronPDF:
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")
wkhtmltopdf C#:
wkhtmltopdf does not include built-in stamping tools. The typical workaround is to embed the desired stamps in the source HTML and CSS before conversion.
IronPDF provides dedicated TextStamper and ImageStamper classes for stamping text and images onto PDF pages — including Google Fonts support and precise alignment controls. wkhtmltopdf does not include built-in stamping tools, but you can achieve a similar result by embedding the stamped content directly in your source HTML and CSS before conversion.
DOCX to PDF Conversion
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")
wkhtmltopdf C#:
wkhtmltopdf focuses exclusively on HTML input, so DOCX conversion requires additional libraries.
IronPDF handles DOCX to PDF conversion through its DocxToPdfRenderer class — three lines of code in the example above. Since wkhtmltopdf's rendering pipeline is predicated on HTML input, DOCX is not a supported source format. Teams needing this capability would integrate a separate conversion library alongside wkhtmltopdf.
Summary of the Code Examples Comparison
To see the full range of IronPDF's capabilities in action, explore the IronPDF how-to guides, which walk through each feature with copy-paste code samples.
Pricing and Licensing: IronPDF vs. wkhtmltopdf
IronPDF
IronPDF has different levels and additional features for purchasing a license. Developers can also buy Iron Suite which gives you access to all of Iron Software’s products at the price of two. If you’re not ready to buy a license, IronPDF provides a free trial so you can explore all the features it has to offer before committing to a license.
-
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 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. 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. 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 additional cost.
-
Uninterrupted product support: IronPDF offers access to ongoing product updates, security feature upgrades, and support from their engineering team.
- Iron Suite: You get access to all Iron Software products including IronPDF, IronOCR, IronWord, IronXL, IronBarcode, IronQR, IronZIP, IronPrint, and IronWebScraper.
wkhtmltopdf
wkhtmltopdf is a free-to-use open-source tool, licensed under the LGPL License which allows you to use wkhtmltopdf in proprietary applications as long as you do not modify the library itself.
Beyond license cost, total project cost includes the developer hours spent managing native binary dependencies, assembling separate libraries for encryption, signing, and redaction, and working around the Qt WebKit engine's limited CSS3 support. For teams evaluating cost over a multi-year project lifecycle, these integration and maintenance costs frequently eclipse the difference between open-source and commercial licensing.
Documentation and Support: IronPDF vs. wkhtmltopdf
IronPDF
IronPDF provides 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.
-
Regular Updates: Monthly product updates to ensure the latest features and security patches.
- PDF API reference: Offers API references so you can get the most out of what our tools have to offer.
For more information, check out IronPDF's extensive documentation, and visit the Iron Software YouTube Channel.
wkhtmltopdf
-
GitHub: wkhtmltopdf's GitHub repository is a place where users can report issues they find while using the tool.
-
Stack Overflow: Here, you can find numerous questions and answers related to wkhtmltopdf, and get community advice.
- Official Documentation: The official documentation provides details on installation, usage, command-line options, and common configurations.
Which Library Should You Choose?
Both IronPDF and wkhtmltopdf address PDF generation in C#, but they target different segments of the complexity spectrum. IronPDF covers the full PDF lifecycle — conversion, encryption, redaction, digital signing, DOCX-to-PDF, and more — through a single NuGet package with an actively maintained Chromium rendering engine. For teams whose projects touch multiple PDF operations, this consolidated approach reduces the number of dependencies to manage.
wkhtmltopdf earned its popularity through a focused, straightforward approach to HTML-to-PDF conversion, and its zero license cost makes it an accessible entry point. Where teams typically hit an inflection point is when requirements expand beyond conversion into editing, security, or compliance — capabilities that fall outside wkhtmltopdf's architectural scope. Combined with the project's archived status and aging WebKit engine, teams with growing requirements often find this the natural moment to evaluate an actively maintained alternative. Ultimately, the right choice depends on your project's current and anticipated PDF requirements.
You can try the 30-day free trial to check out their available features.
Frequently Asked Questions
How can I convert HTML to PDF in C#?
You can use IronPDF's RenderHtmlAsPdf method to convert HTML strings into PDFs. Additionally, you can convert HTML files to PDFs using RenderHtmlFileAsPdf.
What are the key differences between IronPDF and WkHtmlToPdf?
IronPDF offers a comprehensive set of features including text extraction, form handling, encryption, and digital signatures, along with cross-platform compatibility. WkHtmlToPdf is an open-source tool that focuses on straightforward HTML to PDF conversion.
How can I install IronPDF in a .NET project?
IronPDF can be installed using the NuGet Package Manager in Visual Studio by executing the command: Install-Package IronPdf.
Is it possible to encrypt PDFs using IronPDF?
Yes, IronPDF provides options to encrypt PDF files, set passwords, and assign permissions to enhance document security.
Does IronPDF support cross-platform development?
Indeed, IronPDF is compatible with various environments within the .NET framework, including Windows, Linux, Mac, Docker, Azure, and AWS.
Can IronPDF convert DOCX files to PDF?
Yes, IronPDF includes functionality to seamlessly convert DOCX files into PDFs.
What kind of support is available for IronPDF users?
IronPDF offers detailed documentation, 24/5 engineer support, video tutorials, a community forum, and regular software updates.
How do you install WkHtmlToPdf?
To install WkHtmlToPdf, download the executable from its official website, run the installer, and ensure it is included in your system's PATH.
What are the licensing implications of using WkHtmlToPdf?
WkHtmlToPdf is distributed under the LGPL License, allowing free use in both open-source and proprietary applications.
Does WkHtmlToPdf provide support for PDF encryption?
No, WkHtmlToPdf does not include native support for PDF encryption. Additional third-party libraries are needed for encryption capabilities.



