---
type: Article
title: "wkhtmltopdf for .NET: DinkToPdf without libwkhtmltox | Marqius"
description: A .NET package that keeps DinkToPdf's classes and settings, and
  carries its own program. No native file, no arch matching, works on new Linux.
resource: https://marqius.com/blog/wkhtmltopdf-dotnet/
tags:
  - marqius
  - journal
status: stable
sources:
  - id: official-page
    resource: https://marqius.com/blog/wkhtmltopdf-dotnet/
    last_modified: 2026-11-24T13:07:58.217Z
generated:
  by: process:marqius-site-build
  at: 2026-11-24T13:12:45.547Z
x_marqius:
  language: en
  source_sha256: 4e61230682d749d46ac6d244c0ac5fb15ea1ff8085fc616aada82386e340fc4e
  extraction: public-main-content
---

wkhtmltopdf migration

# wkhtmltopdf for .NET: DinkToPdf code, no libwkhtmltox to install

Update, 24 November 2026. Both packages are available on NuGet: Marqius.DinkToPdf and Marqius.Wkhtmltopdf, version 0.12.15.

Marqius November 22, 2026

## The problem this page solves

Your .NET program uses DinkToPdf or its maintained fork. Your code looks like this, and it is fine:

csharp

```
var converter = new SynchronizedConverter(new PdfTools());
var doc = new HtmlToPdfDocument()
{
    GlobalSettings = { ColorMode = ColorMode.Color,
                       Orientation = Orientation.Portrait,
                       PaperSize = PaperKind.A4 },
    Objects = {
        new ObjectSettings() {
            PagesCount = true,
            HtmlContent = "<h1>Invoice 1042</h1><p>Total: 1,630.00 EUR</p>"
        }
    }
};
converter.Convert(doc);
```

But under that code sits a native file, `libwkhtmltox`, that you must install yourself — the right one for the base image and the CPU. On new systems that file is the whole problem:

-   `Unable to load shared library '/app/libwkhtmltox.so'` — the file is not in the image ([see the Docker fix](https://marqius.com/blog/dinktopdf-unable-to-load-libwkhtmltox/))
-   `System.BadImageFormatException … 0x8007000B` — the file is there but built for another CPU

## The change

One reference, and nothing else changes:

xml

```
<PackageReference Include="Marqius.DinkToPdf" Version="0.12.15" />
```

Your `SynchronizedConverter`, `HtmlToPdfDocument`, `GlobalSettings`, `ObjectSettings`, headers, footers, load options — all keep their names and shapes. What changes is underneath: there is no `libwkhtmltox` to load. The program that does the work is inside the package, one statically linked file per platform, selected automatically.

By construction:

-   There is no `.so` to fail to load, so the DllNotFoundException above cannot happen.
-   The platform package matches your runtime identifier, so the BadImageFormatException cannot happen.
-   Alpine, Debian, Ubuntu 26.04, ARM64 — the same reference, no per-base Dockerfile steps.

## Tested on

-   On every package build, by the project's own CI: 34 unit tests on Windows Server 2025 and 2022, Linux x64 and ARM, macOS, and Docker; plus a 27-document comparison with the original DinkToPdf, page by page, on Linux and Windows.
-   By hand on publish day, from the live registry: a clean .NET 8 container, `dotnet add package Marqius.DinkToPdf`, the manual's first example exactly as printed — `invoice.pdf is ready`, 7,842 bytes, one page, the text correct.
-   In a container without fonts, the package answers with its own instructions (install `fonts-liberation2 fonts-dejavu-core`, or copy the fonts from the `marqius/wkhtmltopdf` image) instead of a broken PDF.
-   The benchmark, reproducible from `tests/bench` in the repository: 7 ms per PDF where the libwkhtmltox path takes 212 ms; 265 PDFs a second against 4.7; 23 MB of server space against 45.

## Before you switch

Save a PDF your program makes today. Make the same PDF through the package. Compare:

bash

```
marqius-wkhtmltopdf compare old.pdf new.pdf
```

It gives a verdict and lists each difference with its page and its kind: text, number, date, page break, font, spacing.

## Sources

-   [DinkToPdf and its downloads](https://www.nuget.org/packages/DinkToPdf)
-   [The load error and the manual fix](https://marqius.com/blog/dinktopdf-unable-to-load-libwkhtmltox/)
-   [The last official wkhtmltopdf builds](https://github.com/wkhtmltopdf/packaging/releases/tag/0.12.6.1-3)
-   [Plans and licences](https://marqius.com/wkhtmltopdf-buy/)
-   [Marqius.DinkToPdf developer manual](https://github.com/marqiushq/marqius-wkhtmltopdf-dotnet/blob/main/docs/manual.md)
-   [Marqius.DinkToPdf on NuGet](https://www.nuget.org/packages/Marqius.DinkToPdf/0.12.15)
-   [Marqius.Wkhtmltopdf on NuGet](https://www.nuget.org/packages/Marqius.Wkhtmltopdf/0.12.15)

## Reader questions

### Is my DinkToPdf code compatible?

The classes and settings keep their names and shapes — all of DinkToPdf 1.0.8's API, compared line by line with the original on every build (375 of 375 lines). Even the raw WkHtmlToXBindings calls work, and apps already compiled against DinkToPdf load this package unchanged. See the developer manual in Sources.

### Does it work in Docker and Alpine?

Yes — that is the point. No RUN step installs a native file; the platform package rides with the publish output.

### What about the maintained fork?

Its users face the same native-file step. The same change applies.

### What does it cost?

There are two licences. The Community licence is free: for personal projects, for teaching and learning, and for open-source projects, including their CI test runs and documentation builds. The commercial licence is for businesses.

### Who makes it?

Marqius is commercial software from Simple AI LLC. It is independent of the wkhtmltopdf project, of DinkToPdf and of its fork.

## Keep reading

[Make PDFs in .NET: the Marqius.DinkToPdf manual](https://marqius.com/blog/html-to-pdf-dotnet-dinktopdf/) [The .NET PDF benchmark: 7 ms against 212 ms](https://marqius.com/blog/wkhtmltopdf-dotnet-benchmark/) [wkhtmltopdf as a service: POST the HTML, get the PDF](https://marqius.com/blog/wkhtmltopdf-serve/) [All journal guides](https://marqius.com/blog/)

Source for this page [^official-page].

[^official-page]: https://marqius.com/blog/wkhtmltopdf-dotnet/

[Browse this section](index.md) · [Knowledge index](../index.md)
