Forums | Mahara Community

Support /
Portfolio PDF-Export Without Chrome/Chromium – Alternative with wkhtmltopdf?


Enikö Parrag's profile picture
Posts: 1

18 March 2025, 3:54

Hello,

On server, Chrome or Chromium are not available and cannot be installed. We are looking for an alternative for exporting portfolios and are considering using wkhtmltopdf.

Has anyone tried exporting Mahara portfolio pages to PDF using wkhtmltopdf? Are there any limitations or adjustments needed to ensure a proper rendering of the content?

I’d appreciate any tips or experiences you can share!

Thanks, Enikö

Robert Lyon's profile picture
Posts: 780

20 March 2025, 11:28

Hello Enikö,

Currently there is nothing written for using wkhtmltopdf instead of chrome/chromium.

Though it should be doable though.

The way the 'export to pdf' works is the export system does an 'export to html' first to generate temporary HTML files then loads those files into chrome and have chrome save it as a pdf file.

So to use wkhtmltopdf it would be a matter of swapping out the part where the chromium is loaded/used to generate the pdf from the HTML file and have wkhtmltopdf do this instead.

Another thought on this problem of having things on the webserver we don't want, eg chrome, was to have Mahara do an API call to an external server/service to generate the PDF instead and have the returned pdf file saved on the webserver once done.

But no new code in the export part has been attempted recently.

Cheers

Robert

2 results