Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to install and run wkhtmltopdf on ubuntu 22.04

i recently upgraded my pc to ubuntu 22.04 but wkhtmltopdf is not working on this version of ubuntu. i use my pc to develop ruby on rails projects i tried different methods to install wkhtmltopdf but it shows an error

Invalid platform, must be running on Ubuntu 16.04/18.04/20.04 CentOS 6/7/8, Debian 9/10, archlinux amd64, or intel-based Cocoa macOS (missing binary:

how can run wkhtmltopdf on ubuntu 22.04

like image 609
Atekelt Afework Avatar asked Oct 28 '25 07:10

Atekelt Afework


1 Answers

Here are the steps for Ubuntu 22.04

  1. Run apt install wkhtmltopdf
  2. Download DPKG file from (https://wkhtmltopdf.org/downloads.html) based on your architecture (amd64/arm64/ppc64el). I've given an example for amd64.
  3. Run dpkg -x wkhtmltox_0.12.5-1.trusty_amd64.deb .
  4. Run gzip --best -c usr/local/bin/wkhtmltopdf > wkhtmltopdf_ubuntu_22.04_amd64.gz
  5. Move wkhtmltopdf_ubuntu_22.04_amd64.gz to your gem installation folder. FYI - The various wkhtmltopdf-binaries will be installed here: /usr/lib/ruby/versions/{ruby-version}/lib/ruby/gems/{ruby-version}/gems/wkhtmltopdf-binary-{wkhtmltopdf-binary-version}/bin/
like image 137
Pratik Kalathiya Avatar answered Oct 31 '25 01:10

Pratik Kalathiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!