DEV Community

IronSoftware
IronSoftware

Posted on

Upgrading from DinkToPDF to IronPDF (.NET Guide)

DinkToPDF is a .NET wrapper around wkhtmltopdf, which was officially abandoned in January 2023. If you're using DinkToPDF in production, you're running software built on top of an abandoned binary with known security vulnerabilities and no modern web standards support.

Here's why you need to upgrade to IronPDF for security and standards compliance.

What is DinkToPDF?

DinkToPDF is a .NET Core wrapper for wkhtmltopdf—a C++ binary that converts HTML to PDF using an outdated QtWebKit rendering engine.

The problem: wkhtmltopdf is dead. No updates since June 2020, archived in January 2023.

DinkToPDF doesn't solve wkhtmltopdf's problems—it wraps them in a .NET API.

Why Upgrade from DinkToPDF to IronPDF?

1. Security: wkhtmltopdf Has Unfixed CVEs

wkhtmltopdf is no longer maintained, which means security vulnerabilities will never be patched.

WebKit (the rendering engine wkhtmltopdf uses) had over 1,700 CVEs reported from 2015-2023. wkhtmltopdf's frozen WebKit build from 2015 is vulnerable to dozens of known exploits.

If you're processing untrusted HTML (user-generated content, web scraping), you're exposing your infrastructure.

For regulated industries (healthcare, finance, government), using abandoned software violates compliance standards (HIPAA, SOC 2, PCI-DSS).

IronPDF uses actively maintained Chromium, which receives regular security patches from Google's security team.

2. Standards Compliance: wkhtmltopdf Doesn't Support Modern Web Standards

wkhtmltopdf's QtWebKit engine is based on WebKit from 2015. It doesn't support:

  • Flexbox: Bootstrap 4/5 layouts break
  • CSS Grid: Modern responsive layouts fail
  • CSS Custom Properties (variables): Not supported
  • ES6 JavaScript: Modern frameworks (React, Vue, Angular) don't work
  • Web fonts: Google Fonts often fail to load

DinkToPDF inherits all these limitations.

IronPDF uses Chromium (same engine as Chrome), which supports:

  • ✅ HTML5, CSS3, JavaScript ES2023
  • ✅ Flexbox, CSS Grid, CSS Variables
  • ✅ React, Vue, Angular rendering
  • ✅ Google Fonts, custom web fonts
  • ✅ Modern CSS frameworks (Bootstrap 5, Tailwind CSS)

3. Deployment Complexity: DinkToPDF Requires Native Binaries

DinkToPDF requires:

  1. wkhtmltopdf binary for your platform (Windows x86/x64, Linux, macOS)
  2. Platform-specific DLLs (different for Windows/Linux/macOS)
  3. Process spawning and cleanup (DinkToPDF launches wkhtmltopdf as external process)
  4. Docker configuration pain (install native dependencies)

DinkToPDF Docker deployment (complex):

FROM mcr.microsoft.com/dotnet/aspnet:8.0

# Install wkhtmltopdf and dependencies
RUN apt-get update && apt-get install -y wget
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
RUN apt-get install -y ./wkhtmltox_0.12.6-1.focal_amd64.deb
RUN apt-get install -y libssl1.1

WORKDIR /app
COPY . .
ENTRYPOINT ["dotnet", "MyApp.dll"]
Enter fullscreen mode Exit fullscreen mode

IronPDF Docker deployment (simple):

FROM mcr.microsoft.com/dotnet/aspnet:8.0

RUN apt-get update && apt-get install -y \
    libc6-dev \
    libgdiplus \
    libx11-dev \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY . .
ENTRYPOINT ["dotnet", "MyApp.dll"]
Enter fullscreen mode Exit fullscreen mode

IronPDF is a managed .NET library—no external binaries, no platform-specific wrapper DLLs.

Upgrade Path: DinkToPDF to IronPDF

Step 1: Replace Basic HTML-to-PDF Conversion

Before (DinkToPDF):

using DinkToPdf;
using DinkToPdf.Contracts;
// Install via NuGet: Install-Package DinkToPdf

var converter = new SynchronizedConverter(new PdfTools());

var doc = new HtmlToPdfDocument()
{
    GlobalSettings = {
        ColorMode = ColorMode.Color,
        Orientation = Orientation.Portrait,
        PaperSize = PaperKind.A4
    },
    Objects = {
        new ObjectSettings() {
            HtmlContent = "<h1>Hello World</h1>"
        }
    }
};

var pdf = converter.Convert(doc);
File.WriteAllBytes("output.pdf", pdf);
Enter fullscreen mode Exit fullscreen mode

After (IronPDF):

using IronPdf;
using IronPdf.Rendering;
// Install via NuGet: Install-Package IronPdf

var renderer = new [ChromePdfRenderer](https://ironpdf.com/blog/videos/how-to-render-an-html-file-to-pdf-in-csharp-ironpdf/)();
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Portrait;

var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");
pdf.SaveAs("output.pdf");
Enter fullscreen mode Exit fullscreen mode

50% less code, modern rendering engine.

Step 2: Replace URL-to-PDF Conversion

Before (DinkToPDF):

using DinkToPdf;
// Install via NuGet: Install-Package DinkToPdf

var converter = new SynchronizedConverter(new PdfTools());

var doc = new HtmlToPdfDocument()
{
    Objects = {
        new ObjectSettings() {
            Page = "https://example.com"
        }
    }
};

var pdf = converter.Convert(doc);
File.WriteAllBytes("webpage.pdf", pdf);
Enter fullscreen mode Exit fullscreen mode

After (IronPDF):

using IronPdf;
// Install via NuGet: Install-Package IronPdf

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://example.com");
pdf.SaveAs("webpage.pdf");
Enter fullscreen mode Exit fullscreen mode

Cleaner, faster, more reliable.

Step 3: Replace Headers and Footers

Before (DinkToPDF):

using DinkToPdf;
// Install via NuGet: Install-Package DinkToPdf

var doc = new HtmlToPdfDocument()
{
    GlobalSettings = {
        PaperSize = PaperKind.A4
    },
    Objects = {
        new ObjectSettings() {
            HtmlContent = "<h1>Content</h1>",
            HeaderSettings = { HtmUrl = "header.html" },
            FooterSettings = { Center = "Page [page] of [toPage]" }
        }
    }
};

var converter = new SynchronizedConverter(new PdfTools());
var pdf = converter.Convert(doc);
File.WriteAllBytes("output.pdf", pdf);
Enter fullscreen mode Exit fullscreen mode

After (IronPDF):

using IronPdf;
// Install via NuGet: Install-Package IronPdf

var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align: center;'>Page {page} of {total-pages}</div>"
};

var pdf = renderer.RenderHtmlAsPdf("<h1>Content</h1>");
pdf.SaveAs("output.pdf");
Enter fullscreen mode Exit fullscreen mode

IronPDF's HTML-based headers/footers support full CSS styling.

Step 4: Replace Custom Page Margins

Before (DinkToPDF):

using DinkToPdf;
// Install via NuGet: Install-Package DinkToPdf

var doc = new HtmlToPdfDocument()
{
    GlobalSettings = {
        Margins = new MarginSettings { Top = 20, Bottom = 20, Left = 15, Right = 15 }
    },
    Objects = {
        new ObjectSettings() { HtmlContent = "<h1>Content</h1>" }
    }
};

var converter = new SynchronizedConverter(new PdfTools());
var pdf = converter.Convert(doc);
File.WriteAllBytes("output.pdf", pdf);
Enter fullscreen mode Exit fullscreen mode

After (IronPDF):

using IronPdf;
// Install via NuGet: Install-Package IronPdf

var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.MarginTop = 20;
renderer.RenderingOptions.MarginBottom = 20;
renderer.RenderingOptions.MarginLeft = 15;
renderer.RenderingOptions.MarginRight = 15;

var pdf = renderer.RenderHtmlAsPdf("<h1>Content</h1>");
pdf.SaveAs("output.pdf");
Enter fullscreen mode Exit fullscreen mode

Strongly-typed, compile-time checked configuration.

Step 5: Replace Async Conversion

Before (DinkToPDF):

using DinkToPdf;
// DinkToPDF doesn't support async conversion natively
// You'd need to wrap it manually

var converter = new SynchronizedConverter(new PdfTools());
var task = Task.Run(() => converter.Convert(doc));
var pdf = await task;
Enter fullscreen mode Exit fullscreen mode

After (IronPDF):

using IronPdf;
// Install via NuGet: Install-Package IronPdf

var renderer = new ChromePdfRenderer();
var pdf = await renderer.RenderHtmlAsPdfAsync("<h1>Content</h1>");
await pdf.SaveAsAsync("output.pdf");
Enter fullscreen mode Exit fullscreen mode

IronPDF has first-class async support.

Performance Comparison

DinkToPDF spawns external wkhtmltopdf processes, adding significant overhead.

Benchmark (100 simple HTML documents):

  • DinkToPDF: ~120 seconds (process spawn overhead + outdated engine)
  • IronPDF: ~60 seconds (reused Chromium engine, no process spawning)

IronPDF is 2x faster while also being more secure and supporting modern web standards.

Security Compliance Checklist

Using actively maintained software (IronPDF receives regular updates)

No known unpatched CVEs (Chromium security team patches actively)

Modern TLS support (wkhtmltopdf's WebKit has outdated SSL/TLS)

Input sanitization (IronPDF's Chromium sandbox is more secure)

Standards compliance (HIPAA, SOC 2, PCI-DSS require maintained software)

Cost Comparison

DinkToPDF IronPDF
License cost Free (but based on abandoned wkhtmltopdf) $749/developer
Security patches ❌ None (wkhtmltopdf dead) ✅ Regular Chromium updates
Modern CSS support ❌ No (WebKit 2015) ✅ Yes (Chromium latest)
Support ❌ None (community only) ✅ 24/5 commercial support
Deployment complexity High (native binaries) Low (NuGet package)
Compliance risk High (abandoned software) Low (actively maintained)

DinkToPDF is "free" but costs more in security risk, compliance violations, and developer time.

Migration Checklist

Audit current DinkToPDF usage (HTML conversion, URL conversion, headers/footers)

Install IronPDF via NuGet (Install-Package IronPdf)

Replace DinkToPDF converter with ChromePdfRenderer

Migrate Global Settings to RenderingOptions

Migrate headers/footers to HTML-based approach

Remove wkhtmltopdf binaries from deployment

Update Docker/Kubernetes configs (remove wkhtmltopdf install, add Chromium deps)

Test with modern HTML/CSS (Bootstrap, Flexbox, etc.)

Performance test with real workloads

Security audit (verify no remaining wkhtmltopdf dependencies)

License IronPDF for production use

Train team on IronPDF API

Should You Upgrade?

Upgrade to IronPDF if:

  • Security matters (wkhtmltopdf has unfixed CVEs)
  • Standards compliance is required (HIPAA, SOC 2, PCI-DSS)
  • You need modern CSS/JavaScript support (Flexbox, Bootstrap 5, React)
  • You want simpler deployment (no external binaries)
  • You want a supported product (not abandoned software)

Stay with DinkToPDF if:

  • You're okay with security vulnerabilities
  • You don't need modern web standards
  • You enjoy managing platform-specific binaries
  • Compliance audits aren't a concern
  • (Seriously, upgrade. DinkToPDF wraps abandoned software.)

The Bottom Line

DinkToPDF is a wrapper around abandoned software. wkhtmltopdf died in 2023, taking DinkToPDF's future with it.

IronPDF offers:

  • ✅ Modern Chromium rendering
  • ✅ Active security patches
  • ✅ Standards compliance
  • ✅ Simpler deployment
  • ✅ Commercial support
  • ✅ 2x better performance

For $749/developer, you eliminate security risk, compliance violations, and technical debt. That's a bargain compared to the cost of a breach or failed audit.

Upgrade before security forces your hand.


Written by Jacob Mellor, CTO at Iron Software. Jacob created IronPDF and leads a team of 50+ engineers building .NET document processing libraries.

Top comments (0)