Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

pdf print of report is working, but looks awefull - CSS is missing

By
tertiadev
on 1/13/16, 9:42 AM 903 views

I've tried multiple versions of wkhtmltopdf and also configured the report.url to the address of our odoo onlineshop and the webkit_path is set to /usr/bin/wkhtmltopdf

The pdf report is showing only the text with the footer, but without the header. Everything aligned to the left side and no colors. So it seems the css is not integrated. How could I investigate furthur? Where might be my problem?

Hi Terdiadev,


Usually this has to be doing with the Wkhtmltopdf version. The best is to use version 0.12.1 (as you can read here: https://github.com/odoo/odoo/issues/5177 )
If this is not the problem then have a look at Settings > Technical > Parameters > System parameters and make sure that the parameter 'web.base.url' contains the value 0.0.0.0:8069 or localhost:8069 or 127.0.0.1:8069. If this is not the case change it and create a new parameter.
Give the parameter the name 'web.base.url.freeze' and under value fill in 'True'.

Either one of those two will fix your problem.
Yenthe

Yenthe
on 1/13/16, 11:56 AM
0
tertiadev
On 1/14/16, 9:29 AM

Hi Yenthe,

thanks for your good summary of what should be done!

With your help I got it to work! I'll explain my solution for others:

First I removed my other wkhtmltox with 'apt-get remove --purge wkhtmltox'

Then 'cd ~/tmp' and got me the 0.12.1 wkthmltopdf with 'wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb'

I installed it with 'dpkg -i  wkhtmltox-0.12.1_linux-trusty-amd64.deb' and then copied the files to /usr/bin/ with

'cd /usr/locale/bin/'

'mv wkhtmltoimage /usr/bin'

'mv wkhtmltopdf /usr/bin'

I verified the version with 'cd -' and 'wkhtmltopdf --version'

Then I restarted odoo and went as Yenthe explained to  Settings > Technical > Parameters > System parameters and changed the web.base.url parameter to http://mywebsitewithodoo.com:8069

I figured that I did not need to set web.base.url.freeze to True

Thanks a lot!

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/13/16, 9:42 AM
Seen: 903 times
Last updated: 1/14/16, 9:30 AM