PYTHON · PDFKIT · DJANGO · IMGKIT

Keep pdfkit.
Replace wkhtmltopdf.

pdfkit runs the wkhtmltopdf command. Install Marqius under that name, and your Python PDF calls can stay the same.

curl -fsSL https://marqius.com/marqius-wkhtmltopdf.sh | bash
wkhtmltopdf (current)Marqius (drop-in)
Illustrative pair of matching sample invoices
A simple, drop-in migration Keep your Python workflow Install in minutes Compare your own PDFs
1

Install

Install the compatible program alongside your current wkhtmltopdf.

curl -fsSL https://marqius.com/marqius-wkhtmltopdf.sh | bash
2

pdfkit

If wkhtmltopdf is already on PATH, leave your code as it is. If you configured an absolute path, point it to the installed program.

import pdfkit
pdfkit.from_file("invoice.html", "invoice.pdf", options={"page-size": "A4"})

config = pdfkit.configuration(wkhtmltopdf="/usr/local/bin/wkhtmltopdf")
3

Compare output

Render a representative document and check the PDF before switching production.

marqius wkhtmltopdf invoice.html new.pdf
marqius compare old.pdf new.pdf
PRACTICAL DETAILS

What to check before you switch.

Django and imgkit

Set WKHTMLTOPDF_CMD only when the executable is outside PATH. imgkit can use the wkhtmltoimage name installed beside it.

WKHTMLTOPDF_CMD = "/usr/local/bin/wkhtmltopdf"

config = imgkit.config(wkhtmltoimage="/usr/local/bin/wkhtmltoimage")

Check before changing production

marqius wkhtmltopdf invoice.html new.pdf
marqius compare old.pdf new.pdf
Marqius is proprietary software from Simple AI LLC. It is independent of the wkhtmltopdf project. Other product names identify the tools discussed in these guides.
QUESTIONS & ANSWERS

Python questions

Do I uninstall wkhtmltopdf before trying Marqius?

No. Install Marqius beside it, run a representative HTML document and compare the PDF first. Change the executable path when you are ready.

Does it work in Flask, FastAPI and Celery jobs?

A job that launches pdfkit can point to the compatible executable in the same way as a web process. Make sure the worker environment has the program and fonts, then test its actual job.

What if pdfkit says no executable was found?

Put the installed wkhtmltopdf-compatible executable on PATH or set its absolute path with pdfkit.configuration.

Can django-wkhtmltopdf and imgkit use it?

They launch wkhtmltopdf or wkhtmltoimage commands. Configure the installed executable path where your deployment needs an explicit path, and test both PDF and image output.

Will my CSS or flex layouts render the same?

Check a representative template. Marqius and the old WebKit engine can lay out some CSS differently; comparison on your documents is the safest way to decide.