Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to wkhtmltopdf

I need to convert html text to pdf.

Most answers here recommend to use pdfkit and wkhtmltopdf (https://wkhtmltopdf.org/). However, me company doesn't allow me to install wkhtmltopdf (it is also blocked by admin). There was an option to build from source but it seems like google blocks it due to security reason (https://github.com/wkhtmltopdf/wkhtmltopdf).

Is there an alternative or workaround?

I'm very new to python and don't have programming background, appreciate every detailed explanation.

like image 916
PoonLamy Avatar asked Jan 28 '23 10:01

PoonLamy


1 Answers

Yes you can just download it and run it directly. I used that for a shared host (WebFaction) where I have SSH but not root access nor installation option.

cd /tmp
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd wkhtmltox/
./bin/wkhtmltopdf

You should be good.

Note that version 0.12.5 is out but has no linux-generic version. Therefore you may want to stick to 0.12.4 for now.

like image 122
vinyll Avatar answered Feb 27 '23 11:02

vinyll