Fix Header and footer not showing in Odoo PDF Print

WKHTMLTOPDF error while print

Start writing here...

SOLUTION TO HAVE PRINT HEADERS:

I had the same issue, and I was able to resolve it by following shaneebkhan's steps but in this way

The steps are as follows (ChatGPT assisted us with this):

  1. Install wkhtmltopdf on Ubuntu 22: To install wkhtmltopdf on Ubuntu 22, open a terminal and execute the following command:

    sudo apt install wkhtmltopdf
    
  2. Check the current version of wkhtmltopdf: After installation, verify the current version of wkhtmltopdf with the following command:

    wkhtmltopdf --version
    

    If the version is 0.12.6, you will need to remove it and download version 0.12.5.

  3. Uninstall version 0.12.6: Open a terminal and execute the following command to uninstall the current version of wkhtmltopdf (0.12.6):

    sudo apt remove wkhtmltopdf
    

    Then, if you wish, you can remove unused dependencies with the command:

    sudo apt autoremove
    
  4. Download and install version 0.12.5: Download the deb package of wkhtmltopdf version 0.12.5 with the following command (make sure to copy the entire command):

    wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
    

    Next, install the downloaded package along with the required fonts:

    sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
    sudo apt-get install xfonts-75dpi
    sudo apt-get update
    
  5. Fix broken packages (if necessary): If, after following the previous steps, you encounter broken packages, you can try to fix them with the following command:

    sudo apt --fix-broken install
    

Once you have followed these steps, verify the wkhtmltopdf version again to confirm that you are now using version 0.12.5 with the following command:

wkhtmltopdf --version

It should display version 0.12.5 if everything went well.

I hope this guide helps you resolve the wkhtmltopdf installation issues and generate reports correctly in Odoo 16. Good luck!

AS A RECOMMENDATION, some cases may require the installation of libssl1.1 to address additional issues. You can try downloading and installing it with the following commands:

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.22_amd64.deb sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.22_amd64.deb

To read more about the error click here

Sign in to leave a comment