wkhtmltopdf to Chrome: free command translator
Paste your wkhtmltopdf command. You get the Chrome flags, a Playwright snippet, a Puppeteer snippet and the print CSS for the same page, and a plain list of every option that has no Chrome equivalent. wkhtmltopdf is archived and no longer packaged for current Debian, so many teams are moving their templates to headless Chrome. It runs in your browser: the command is not sent anywhere.
Nothing translated yet.
Option by option
CSS for your page
Playwright (Node)
Puppeteer (Node)
Chrome command line
Notes
What changes when you leave wkhtmltopdf
- Screen versus print CSS. wkhtmltopdf prints with screen CSS unless you pass
--print-media-type. Chrome prints with print CSS. If your page has@media printrules, they now apply. The translator keeps the old behaviour withemulateMedia({ media: "screen" }). - Backgrounds. wkhtmltopdf prints backgrounds by default. Playwright and Puppeteer do not, so the code sets
printBackground: true. - Headers and footers.
--footer-center "[page] of [topage]"becomes a CSS page margin box,@bottom-center { content: counter(page) " of " counter(pages); }. Margin boxes need Chrome 131 (November 2024) or newer. Tokens such as[date]and[title]have no margin-box equivalent; the translator says what to use instead. - Table of contents.
tochas no equivalent. Chrome does not support the CSS that would put page numbers in a contents list (we printed a test page on Chromium 141 to check), so write the list as HTML links. - Grayscale.
-ghas no switch.html { filter: grayscale(1) }looks right but turns the whole page into pictures: on Chromium 141 the printed PDF had no fonts and no selectable text. Convert the finished PDF with Ghostscript instead. - Zoom and smart shrinking.
--zoombecomesscale, which is not identical. Chrome has no smart shrinking; it lays the page out at the paper width.
What it knows and where it stops
It recognises all 122 options in the wkhtmltopdf 0.12.6 manual (the official usage text, read on 13 October 2026) with the right number of arguments, and reports anything else as not recognised. Sizes it does not know (wkhtmltopdf takes them from Qt) are reported, not guessed. We ran it on three real commands from public code (an open-source Markdown converter, a collections-management system and the manual's own example) and fixed what it got wrong: one of them writes [toPage] with a capital P, which it now reads as the manual's [topage] and says so. It translates the command, not your HTML: it cannot tell you that a flexbox workaround in your old template should be deleted, or how your page will look. The output code was checked for syntax, and the CSS block was printed in Chromium 141 to confirm the page size, orientation and "Page 2 of N" footer; Playwright and Puppeteer were not run against your pages. The outline and tagged options need a recent Playwright or Puppeteer.
Related free tools: Markdown to PDF in your browser and the guide HTML to PDF page breaks in Chrome (repeating table heads, keeping totals together, Page X of Y).
The same engine is a free MIT command line tool, wk2chrome. If you generate invoices, quotes, statements or reports, Foliokit is seven finished print-ready templates, already written for Chrome, with a command that fills them from JSON or Markdown.