Skip to content

Build the PDF with PDFKiln instead of wkhtmltopdf 0.12.4 - #1305

Open
Jamalofski wants to merge 1 commit into
thewca:draftfrom
Jamalofski:wkhtmltopdf-pdfkiln
Open

Jamalofski wants to merge 1 commit into
thewca:draftfrom
Jamalofski:wkhtmltopdf-pdfkiln

Conversation

@Jamalofski

Copy link
Copy Markdown

The deploy workflow builds the PDF of the Regulations with wkhtmltopdf 0.12.4, from 2017; wkhtmltopdf is archived and has had no release since 2020. This installs PDFKiln 1.5.1 instead, a drop-in replacement that keeps wkhtmltopdf's command line and renders with a current Chromium (MIT, https://github.com/pdfkiln/pdfkiln). It follows the hardening of #1303: a pinned release, its SHA-256 checked, no new action. The Debian package installs /usr/bin/wkhtmltopdf, which wrc calls, and the AppArmor profile Chromium's sandbox needs on ubuntu-24.04.

Tested with the three lines as written, on Ubuntu 24.04 with wrc 1.9.0, as a user without root: wrc --target=pdf gives 30 pages as with wkhtmltopdf 0.12.4 and 0.12.6, the same 26 bookmarks and the page numbers. Page breaks fall a few lines apart on some pages, as Chromium's line heights differ slightly from Qt's.

Disclosure: I maintain PDFKiln.

@FinnIckler

Copy link
Copy Markdown
Member

I assume this means we can stop pinning Ubuntu 24.04?

@Jamalofski

Copy link
Copy Markdown
Author

Yes: the same 1.5.1 package installs on ubuntu-26.04 with the AppArmor profile Chromium's sandbox needs, and our command tests pass there (the release CI runs them on 24.04 and 26.04). I left the pin alone to change one thing at a time; I can switch the job to ubuntu-latest in this PR if you'd like.

@lgarron

lgarron commented Dec 3, 2026

Copy link
Copy Markdown
Member

I would be opposed to switching to a vibe-coded third-party project for this.

I'd rather use either headless Chromium directly, or using something like Playwright.

@Jamalofski

Copy link
Copy Markdown
Author

Fair enough, it's your call. In case it helps with Playwright, two things I ran into testing wrc 1.9.0 under Chromium:

  • wrc's @font-face rules use font-style: italic, oblique. Chromium rejects the list, the italic face takes the regular slot, and the whole PDF comes out in italics. One value per rule fixes it.
  • The running header gets section and subsection from wkhtmltopdf's query string. Chromium's header templates only offer page numbers, title, URL and date.

Feel free to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants