Search code examples
odoowkhtmltopdf

Unable to open document “pdf” odoo


Installed V8 on 14.04.01, when printing report it throws following message:

Unable to open document “file:///tmp/sale.report_saleorder-1.pdf”.

File type plain text document (text/plain) is not supported

Any help is very much appreciated. enter image description here


Solution

  • This issue is due to broken wkhtmltopdf package.

    You can try using commands below to install them -

    First remove the broken wkhtmltopdf from your system. using -

    sudo apt-get purge wkhtmltopdf
    

    Then try using the commands below -

    cd /tmp/
    

    then Download the recommended version of wkhtmltopdf for Odoo server, currently 0.12.1: -

    sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
    

    then install the package using dpkg :-

    sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
    

    To function properly we’ll need to copy the binaries to an adequate location:

    sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
    sudo cp /usr/local/bin/wkhtmltoimage /usr/bin