This question has been flagged
4 Replies
7957 Views

I have a problem with header & footer when it be image in pages exceeded on 3 pages I miss the header and footer Although I make upgrade for wkhtmltopdf . please help me for this issue thank you so much

Avatar
Discard
Best Answer

Mohammed Khamis,

There mayb be two possibilities for qweb header when report doesn't give proper report format.

1) When wkhtmltopdf is not successfully installed with proper os compatible version than header and footer doesn't appears in the report. I faced the same issue many time with different os finally in my system ubuntu 12.04.5 with precise version of wkhtmltopdf is working perfectly without any issues.

2) when you customize your header and your report is overlapped with header than you need to set paper format in, that you can extended the header and footer margin.

Hope this will helps you.

Regards,

Anil.


Avatar
Discard
Best Answer

If you are experiencing issues with the header and footer not appearing when using images in pages that exceed three pages in the PDF generated by Odoo, here are a few steps you can take to troubleshoot and resolve the problem:

  1. Check the page size and image size:

    • Verify the page size configuration in your Odoo settings. Ensure that it is set to an appropriate size to accommodate the content, including the images.
    • Check the size of the images you are including in the document. Large images may cause layout issues and push the content beyond the page boundaries.
  2. Adjust the header and footer position:

    • In the document template for the header and footer, try adjusting the positioning of the elements to accommodate the larger content.
    • You can use CSS properties like position, top, bottom, left, and right to fine-tune the positioning of the header and footer.
  3. Upgrade wkhtmltopdf to the latest version:

    • Ensure that you have the latest version of wkhtmltopdf installed. You can download it from the official website: https://wkhtmltopdf.org/downloads.html
    • Restart your Odoo server after installing the updated version to apply the changes.
  4. Split the content into multiple pages:

    • If the document content, including images, exceeds the page limits, consider splitting the content into multiple pages manually.
    • You can use Odoo's QWeb templating language to conditionally render the content based on page breaks. For example, you can check the page number and conditionally render headers and footers after a specific page.
  5. Optimize images:

    • If the size of the images is causing layout issues, you can optimize them to reduce their file size without compromising too much on the image quality.
    • Use image editing tools or online image optimization services to compress the images and reduce their file size.
  6. Use external CSS for styling:

    • Instead of relying solely on the header and footer templates, you can define the styles for the header and footer using external CSS files.
    • This approach provides more flexibility in handling layout issues and controlling the positioning of elements.


Avatar
Discard
Best Answer

hi, 

hear the problem was installation of wkhtmltopdf 

i have same issue in odoo 16 finally i corrected by proper installation of wkhtmltopdf

first we have to install wkhtmltopdf ubuntu 22 terminal

      1.    apt install wkhtmltopdf

      2. wkhtmltopdf --version 

      whether its 0.12.6 remove and download 0.12.5

      3.wget https://github\\\.com/wkhtmltopdf/wkhtmltopdf/releases/download/0\\\.12\\\.5/wkhtmltox_0\\\.12\\\.5\\\-1\\\.bionic_amd64\\\.deb

     \\\ 4\\\.sudo\\\ dpkg\\\ \\\-i\\\ \\\ wkhtmltox_0\\\.12\\\.5\\\-1\\\.bionic_amd64\\\.deb

sometimes\\\ it\\\ may\\\ error\\\ then\\\ try\\\ to\\\ install\\\ one\\\ or\\\ two\\\ things 

    \\\ 1\\\.wget\\\ http://archive\\\.ubuntu\\\.com/ubuntu/pool/main/o/openssl/libssl1\\\.1_1\\\.1\\\.1\\\-1ubuntu2\\\.1\\\~18\\\.04\\\.22_amd64\\\.deb

   \\\ 2\\\.sudo\\\ dpkg\\\ \\\-i\\\ libssl1.1_1.1.1-1ubuntu2.1~18.04.22_amd64.deb

    3.sudo apt-get install xfonts-75dpi

    4.sudo apt-get update

    5.apt --fix-broken install


finally confirm  the "wkhtmltopdf version is  0.12.5"

Avatar
Discard
Best Answer

This is not solution for Your problem, but it may help (v8,qweb).

I had "strange" effects with usage of wkhtmltopdf in different versions e.g. visible/invisible headers. After many tries with instalations of clean odoo, I have seen, that view of generated report depended ALSO on update module "report" but NOT ONLY version of wkhtmltopdf. Of course module "report" was not modified.

Use option:

--update=report

I work on debian (8, little 7). All versions of wktmltopdf I have got from its home page. I am newbie in odoo.

Avatar
Discard