Skip to content

PdfNetStack and wkhtmltopdf compared

View as Markdown

wkhtmltopdf is a command line tool that renders HTML to PDF with the Qt WebKit engine. PdfNetStack.Html converts HTML and CSS to PDF with a layout engine written in C#. It shipped in PdfNetStack 1.1 and is on NuGet.

wkhtmltopdf. wkhtmltopdf and wkhtmltoimage are command line tools that render HTML into PDF and image formats “using the Qt WebKit rendering engine”. They run headless, without a display, and there is also a C library (website). Pages may run JavaScript, which is on by default. Headers and footers can be text or HTML documents with page numbers, headings become PDF bookmarks, and a table of contents can be generated from the headings (usage).

PdfNetStack.Html. A layout engine in C#, no browser: the CSS cascade, block, inline, table, flex and grid layout, floats and positioning, paged media with @page, margin boxes, named pages and running headers and footers, repeated table headers, tagged PDF for accessibility, web fonts, and right to left and Arabic text. Since 1.2, hyphens: auto hyphenates with the patterns of the PdfNetStack.Hyphenation package. Nothing is fetched from the network unless you pass a resource loader (HTML to PDF). The result is a PdfDocument that can be signed, encrypted or saved as PDF/A with the rest of PdfNetStack.

  • The wkhtmltopdf repository was “archived by the owner on Jan 2, 2023” and is read only (repository).
  • The current stable series is 0.12.6, released in June 2020 (downloads).
  • Its status page explains that “QtWebKit was eventually deprecated in 2015 and removed in 2016”, and advises: “Do not use wkhtmltopdf with any untrusted HTML” (status page).
  • wkhtmltopdf. LGPL-3.0 (repository, website).
  • PdfNetStack.Html. MIT, like the rest of PdfNetStack.

Read each license yourself before you decide. This page is not legal advice.

PdfNetStack.Htmlwkhtmltopdf
LicenseMITLGPL-3.0
How it runsManaged .NET code in your processA native command line program, or its C library
EngineC# layout engineQt WebKit
JavaScriptNoYes, on by default
Headers and footers with page numbersCSS margin boxes and running elementsText, or HTML header and footer documents
Bookmarks from headingsYes, on by defaultYes, on by default
Printed table of contents with page numbersNo: target-counter() and leader() are not supportedGenerated from headings
Flexbox and gridYesNot listed
Tagged PDFYes, on by defaultNot listed
Untrusted HTMLNo network without a loader, files only under the base folder, bounded parsing and layoutStatus page advises against it
HTML to imagesNoYes, wkhtmltoimage
Latest release1.2.0, November 20260.12.6, June 2020
MaintainedYesRepository archived on 2023-01-02

Sources for the wkhtmltopdf column: website, repository, status page, downloads, usage. “Not listed” means the feature is not in the product’s own documentation on the check date.

  • Your templates are tuned to WebKit’s rendering and already produce the output you want, and you convert only HTML you control. Its status page also suggests running it under a Mandatory Access Control system such as AppArmor or SELinux.
  • Your templates need JavaScript to build the page. PdfNetStack.Html does not run scripts. For sites that use dynamic JavaScript, the wkhtmltopdf status page itself suggests puppeteer or one of its wrappers; see headless Chromium.
  • You need images as well as PDF from the same HTML. wkhtmltoimage renders to image formats; PdfNetStack.Html writes PDF only.
  • You want a maintained engine that runs inside your .NET process, with no native program to install or update.
  • You convert HTML you do not fully trust.
  • You want paged media from CSS: margin boxes, running elements, named pages and repeated table headers, or tagged PDF.

Product names are trademarks of their respective owners, mentioned for reference only, without affiliation or endorsement.

Checked on 2026-11-12.