Migrate Rotativa.AspNetCore off wkhtmltopdf
Keep ViewAsPdf and your existing view. Put Marqius in the folder where Rotativa looks.
Marqius

An ASP.NET Core app returns invoices with Rotativa. The controller still has the order details, but its publish folder is missing the program Rotativa looks for.
Marqius is a drop-in replacement for wkhtmltopdf. Your app can keep using Rotativa.AspNetCore to ask for a PDF.
Why this helps
Keep the controller and view. Put Marqius where Rotativa already looks for the wkhtmltopdf file, then check one invoice through the actual web route.
Make your first PDF
Start with Invoice 1001 for 120.00 EUR. Open the example PDF to see what this library’s test should produce. The kit includes all 14 sample projects and a more detailed print demo for checking tables and page breaks. Open START-HERE.html after unzipping. Download the library starter kit (ZIP) · Open the library example PDF
With Docker running, unzip the demo to a fresh folder and open a terminal in the folder containing examples/. You can also start in an empty folder. The command in step 3 will fetch the files for you inside the container.
1. Open a fresh test container
docker run --rm -it --mount "type=bind,source=$PWD,target=/proof" mcr.microsoft.com/dotnet/sdk:10.0 bashRun the rest of the steps in the shell that just opened. The container is a fresh Linux test environment. Your host folder is mounted as /proof, so you can open the saved PDF after the test.
2. Install the tools and Marqius
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl unzip fonts-dejavu-core poppler-utils
mkdir -p /work
cd /work
curl -fsSLo install-marqius.sh https://marqius.com/marqius-wkhtmltopdf.sh
bash install-marqius.sh --version 0.12.8 --prefix /work/bin
export PATH="/work/bin:$PATH"
export WKHTMLTOPDF_BINARY=/work/bin/marqius-wkhtmltopdf
"$WKHTMLTOPDF_BINARY" --version
wkhtmltopdf --versionThe version output should include marqius-wkhtmltopdf 0.12.8. Marqius supplies the wkhtmltopdf command inside this test container.
3. Bring the demo project into the test container
cd /work
if [ -d /proof/examples/rotativa-aspnetcore ]; then
cp -R /proof/examples .
else
curl -fsSLo wrapper-demos.zip https://marqius.com/download/wkhtmltopdf-demo/0.12.8/marqius-wrapper-demos.zip &&
unzip -oq wrapper-demos.zip
fi4. Put Marqius where Rotativa looks and build the app
cd examples/rotativa-aspnetcore
mkdir -p wwwroot/Rotativa
install -m 0755 "$WKHTMLTOPDF_BINARY" wwwroot/Rotativa/wkhtmltopdf
dotnet build --configuration Release5. Call the invoice route and stop the test app
ASPNETCORE_URLS=http://127.0.0.1:5043 dotnet run --no-build --configuration Release > /proof/server.log 2>&1 &
server_pid=$!
curl -fsS --retry 20 --retry-connrefused --retry-delay 1 --max-time 5 http://127.0.0.1:5043/invoice -o /proof/invoice.pdf
kill "$server_pid"6. Check that the PDF contains the right invoice
pdfinfo /proof/invoice.pdf | grep '^Pages:'
pdftotext /proof/invoice.pdf - | grep -F 'Invoice 1001'
pdftotext /proof/invoice.pdf - | grep -F '120.00'
chmod a+r /proof/invoice.pdfLook for one page, the invoice number and the amount. Type exit to close the test container. Open invoice.pdf in the folder you created on your computer.
How to switch your own app to Marqius
Keep ViewAsPdf and supply Marqius under the wkhtmltopdf filename in the directory RotativaConfiguration.Setup selects. This guide covers Rotativa.AspNetCore on Linux.
Use the Linux download for the CPU architecture of your deployed container. If using the APT package, copy its executable into the directory Rotativa expects under the name wkhtmltopdf as part of the application build. Debian installation guide · Downloads for other environments
Apply the change in Program.cs and your publish or container build. This setup expects the executable under the configured web root's Rotativa directory.. Retain the existing rendering options unless your comparison identifies a reason to change them.
Rotativa.AspNetCore.RotativaConfiguration.Setup(app.Environment.WebRootPath, "Rotativa");Try it with a document you know
During deployment, put the Marqius Linux binary at wwwroot/Rotativa/wkhtmltopdf and give it execute permission. Prevent requests from serving that directory as static files. If you already use another directory, retain that one and confirm the resolved path in staging. Check that the publish artifact includes the binary.
Render the real MVC action in staging and inspect margins, repeated table headings and the footer. Direct libwkhtmltox bindings such as DinkToPdf have a different integration and cannot use this setup line.
Check the old and new PDFs
Save a PDF from the old setup. Make it again with the same data and fonts. Check the words, amounts and page breaks. Keep the old program path handy so you can switch back if you need to. The runnable Rotativa.AspNetCore example exercises a sample PDF through the wrapper. The developer manual chapter records the test conditions and constraints. The public comparison scoreboard reports differences for the wkhtmltopdf and Marqius renderers.
All 14 library guides · Elixir pdf_generator · go-wkhtmltopdf · Try Marqius for 30 days
Reader questions
Does RotativaConfiguration.Setup take the executable path?
In this example it selects a directory under the web root. Rotativa looks for the wkhtmltopdf filename inside that directory. Verify the resolved path for your installed version.