syncMyMoodle icon indicating copy to clipboard operation
syncMyMoodle copied to clipboard

wkhtmltopdf has been EoL for over 2 years now

Open D-VR opened this issue 2 months ago • 2 comments

Currently we use https://pypi.org/project/pdfkit/ to generate PDFs out of etests, however that depends on wkhtmltopdf which has stopped development and was archived 2 years ago (https://github.com/wkhtmltopdf/wkhtmltopdf). There is no easy way to install/get releases on modern systems. Nor is it recommendable as it's vulnerable if it ingest malicious content.

We should look for an alternative which is easy to install, can handle modern html content and is not as vulnerable. Seems like one way to go would be using a setup with Puppeteer which uses a headless chromium to create PDFs, however this is a not insignificant install and would remain optional.

D-VR avatar Nov 19 '25 12:11 D-VR

There are WeasyPrint and xhtml2pdf as lightweight solutions though I am not sure how good their accuracy is. Puppeteer, Playwright and Selenium all want to download a headless browser. AFAIK this can be suppressed and manually pointed to an existing browser but that is quite fragile and unsupported/discouraged.

Another idea would be to use QWebPage via PySide6 which pulls in a bit of Qt but generally has a simpler setup as the browser is already bundled (and if we decide to eventually add a GUI we would need to pull it in anyhow)

septatrix avatar Nov 19 '25 13:11 septatrix

this issue also relates to #55

D-VR avatar Nov 20 '25 08:11 D-VR