Skip to content

Rotativa alternative

Rotativa Alternative for ASP.NET Core and DinkToPdf Projects

Replace the Rotativa folder and the DinkToPdf native library with one HTTP call from your controller. Your Razor view renders in managed Chromium, so flexbox, grid, web fonts and JavaScript charts come out the way they look in the browser, and nothing from wkhtmltopdf ships in your container. Try it on any URL or HTML below.

  • PDF and archive in one call
  • Plans from $49 a month
  • Your HTML stays yours

Live demo

Runs in your browser. Nothing is uploaded. One PDF free to try, then a plan.

Your PDF is downloading. That was the free one. The Starter plan converts as many as you need, for $49 a month or $288 a year, half price.

See the plan

Short answer

The practical Rotativa alternative for ASP.NET Core keeps your Razor views and swaps the engine. Rotativa.AspNetCore and DinkToPdf both drive wkhtmltopdf, a project archived in 2023 whose last release is 0.12.6 from June 2020, so they inherit its old WebKit layout and an unpatched SSRF flaw. Render the view to an HTML string, POST it to SitePDF, and you get a Chromium accurate PDF with headers, footers and page numbers, plus an optional dated archive of each document. Plans start at $49 a month for 10,000 renders.

Written and fact checked by the SitePDF team.

Five ways out of Rotativa and DinkToPdf side by side

Every route keeps your data model. They differ on the engine that lays out the page, what you must ship inside your app, and whether the Razor views you already have survive the move.

Option Engine What ships with your app Where it hurts Best for
Stay on Rotativa.AspNetCore or DinkToPdf wkhtmltopdf 0.12.6, old Qt WebKit The wkhtmltopdf binary or libwkhtmltox for every OS you deploy to No flexbox or grid, unreliable JavaScript, CVE-2022-35583 with no fixed release Internal reports on trusted HTML that already print correctly
PuppeteerSharp or Playwright for .NET Current Chromium A Chromium build of a few hundred MB plus its Linux libraries Memory per page, browser crashes and pool sizing become your job Teams that must keep every byte of HTML on their own servers
QuestPDF Its own C# layout engine A managed NuGet package, no browser You rebuild every document in C# code, your Razor views are not reused New documents designed from scratch by developers
IronPDF or another commercial library Embedded Chromium A large native package and a license key per deployment Per developer license cost and the same container weight as a browser Offline or desktop apps that cannot call out
SitePDF rendering API Managed current Chromium Nothing, one HttpClient call HTML leaves your network for the render, and each render counts toward a plan Web apps on Linux, Docker or Azure App Service that print invoices, statements and reports

The honest read: if your Rotativa PDFs are simple tables, nobody outside your company writes the HTML, and you deploy to one Windows server, there is no emergency and you can leave it. The move pays off when you containerize, when a designer asks for a flexbox layout, when user content reaches the template, or when a security review flags the CVE. Our C# PDF library comparison covers the free .NET options in more depth.

Why Rotativa and DinkToPdf break when you move to Linux and Docker

Rotativa.AspNetCore is a thin wrapper. Its README asks you to put wkhtmltopdf.exe in a folder named Rotativa under the web root (no extension on Linux and macOS) and call app.UseRotativa(). The package is still maintained, with version 1.5.0 published on NuGet in October 2026, but the binary it runs is not. DinkToPdf goes one step deeper and loads the native libwkhtmltox library into your process. Its last release, 1.0.8, is from April 2017 and targets .NET Standard 1.6, as its NuGet listing shows.

That is why the trouble starts on deploy, not on your laptop. The official .NET container images do not include wkhtmltopdf or the font and rendering libraries it needs, so the first request fails with a missing shared library or prints boxes instead of text. DinkToPdf adds its own trap: the converter is not thread safe, so it has to be a singleton SynchronizedConverter, and every PDF in the app queues behind one lock. Teams usually find this when month end invoices pile up. The same engine sits under PHP, Python and Ruby wrappers, which our wkhtmltopdf alternative page walks through.

The security finding that ends most Rotativa reviews

In 2022 researchers published CVE-2022-35583, a server side request forgery in wkhtmltopdf 0.12.6. HTML handed to the converter can make it fetch internal addresses, such as a cloud metadata endpoint, and print the response into the PDF. Because the project was archived, there is no patched version to upgrade to. If a customer name, a note field or an uploaded logo URL reaches your Razor view unescaped, a scanner will flag the dependency and an auditor will ask how you isolate it. Rotativa and DinkToPdf cannot answer that by themselves, because they are the vulnerable process.

Moving a ViewAsPdf action to an API call

The migration is smaller than it looks because your Razor views stay. Rotativa's ViewAsPdf does two things: it renders the view to HTML and it hands that HTML to wkhtmltopdf. You keep the first half and replace the second.

  1. Render the view to a string. Use a small IRazorViewEngine helper, the common RazorViewToStringRenderer pattern, so the controller gets the finished HTML of Invoice.cshtml with its model.
  2. Make assets absolute. wkhtmltopdf read files from disk. A remote renderer needs full URLs for CSS, images and fonts, or inline them. This one change fixes most first-try differences.
  3. Map the options. PageSize becomes format, PageMargins becomes margin, and CustomSwitches for headers and footers become header_html and footer_html, where the pageNumber and totalPages classes print page numbers. Our margins, headers and footers guide has the details.
  4. Return the file. Stream the returned PDF to the browser with File(bytes, "application/pdf"), or store the link. Remove the Rotativa folder and the native library from the image.
  5. Run both for a week. Print the same records through both paths, compare the PDFs, then delete the old call.

Blazor teams use the same approach with a component rendered to HTML, explained on the Blazor HTML to PDF page.

A worked example with 8,000 invoices a month

Take one ASP.NET Core app on Linux that prints 8,000 two page invoices a month, most of them in the first three business days. On DinkToPdf with a singleton converter at roughly 1.5 seconds per document, the month end batch of 6,000 invoices is 2.5 hours of serialized work on one instance before any retries. These are planning assumptions, so time your own template before you size anything.

Moving to PuppeteerSharp removes the lock but adds a browser to the image and a page pool to tune, and the PuppeteerSharp deployment guide for Azure and Docker lists the libraries and fonts that image needs. Moving to an API removes both: 8,000 renders fit the Starter API plan at $49 a month or $288 a year, and three concurrent renders clear the same 6,000 invoice batch in under an hour at the same 1.5 seconds. At 50,000 renders the Growth plan is $99 a month or $588 a year with 10 concurrent renders. Add archive: true on invoices and statements and you also keep a timestamped copy of exactly what each customer received, which helps when someone disputes a total. See the pricing page for every tier.

When to stay on Rotativa, and when a library beats an API

Stay where you are if the app runs on Windows, the HTML is fully under your control, the layouts print correctly today and nobody has asked for modern CSS. Pick QuestPDF when developers design the documents and you would rather write C# than HTML. Pick a commercial library when PDFs must be produced offline or inside a desktop app, and read our IronPDF pricing breakdown before you budget per developer seats, or the iText and .NET library license costs if AGPL terms are on your list. Pick a rendering API when you deploy to containers or App Service, when templates are already HTML and CSS, and when you want a record of each document without building one.

A Rotativa ViewAsPdf action rewritten as one HTTP call. Your Razor view still produces the HTML.
using System.Net.Http.Headers;
using System.Net.Http.Json;

// before: return new ViewAsPdf("Invoice", model) { PageSize = Size.Letter };
public async Task<IActionResult> InvoicePdf(int id)
{
    var model = await _invoices.GetAsync(id);
    string html = await _razor.RenderViewToStringAsync("Invoice", model);

    var res = await _http.PostAsJsonAsync("https://api.sitepdf.com/v1/render", new
    {
        html,
        format = "Letter",
        margin = "18mm",
        footer_html = "<div style='font-size:9px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>",
        archive = true
    });
    res.EnsureSuccessStatusCode();

    // { "pdf_url": ".../v1/documents/doc_r8k2m.pdf", "pages": 2,
    //   "archive": { "id": "arc_r5t1q", "captured_at": "2026-11-17T08:41:09Z" } }
    var doc = await res.Content.ReadFromJsonAsync<RenderResult>();
    var pdf = await _http.GetByteArrayAsync(doc!.pdf_url);
    return File(pdf, "application/pdf", $"invoice-{id}.pdf");
}

This is the documented API call shape. Full request and response walkthrough.

Questions about this job

Does Rotativa work with ASP.NET Core?
Yes, through the Rotativa.AspNetCore package, which supports .NET Core 3.1 through current .NET versions. You place the wkhtmltopdf binary in a Rotativa folder under the web root and call UseRotativa at startup. It still runs wkhtmltopdf, so it keeps that engine's old layout support and security issue.
Is DinkToPdf still maintained?
No release has shipped since version 1.0.8 in April 2017. DinkToPdf wraps the native libwkhtmltox library from wkhtmltopdf, which was archived in 2023, so neither the wrapper nor the engine receives fixes. It still installs and runs, but you own the native library and its known vulnerability.
What can I use instead of Rotativa in .NET 8?
Keep your Razor views and change the engine. PuppeteerSharp or Playwright for .NET run Chromium inside your app, QuestPDF builds documents in C# code, and a rendering API such as SitePDF takes the rendered view as HTML over HTTP and returns the PDF without a browser in your container.
Why does Rotativa fail on Linux or in Docker?
The official .NET images do not include wkhtmltopdf or the system libraries it needs, and the binary must sit in the Rotativa folder without the .exe extension and be executable. Missing fonts also print boxes. A rendering API avoids all three because nothing native runs in your image.
How much does a Rotativa replacement cost?
PuppeteerSharp, Playwright and QuestPDF's community license cost nothing in fees but add hosting and maintenance time. Commercial .NET libraries charge per developer. SitePDF API plans start at $49 a month for 10,000 renders and $99 for 50,000, with yearly billing at $288 and $588.

Index

More PDF and archiving tools

Get started

Render and archive with one API call

A pixel perfect PDF and a dated copy of the page from the same request. Plans from $49 a month, half price billed yearly.

HTML to PDF, in your browser

Buy the plan