Skip to content

Odoo Report Header/Footer Overlap — PDF Layout and Margin Issues Fix

DeployMonkey Team · March 24, 2026 9 min read

Report Header/Footer Overlap Issues

When printing PDF reports (invoices, delivery slips, etc.), the layout breaks:

Issues:
- Header overlaps the first line of content
- Footer covers the last table rows
- Header/footer only appears on the first page
- Company logo stretches or disappears
- Different margins on different pages
- Content flows into the header/footer area

Understanding Odoo Report Layout

Odoo uses wkhtmltopdf to convert HTML to PDF. The layout relies on CSS margins and the external_layout template that provides header and footer blocks.

Fix 1: Adjust Paper Format Margins

# The paper format defines page margins:
# Settings > Technical > Reporting > Paper Format
# Or: Company > Document Layout > Paper Format

# Adjust margins:
# Top Margin: 40mm (increase if header overlaps)
# Bottom Margin: 30mm (increase if footer overlaps)
# Left Margin: 7mm
# Right Margin: 7mm
# Header Spacing: 35 (mm between top edge and content start)

# The key is Header Spacing:
# It must be LARGER than your header height
# If header is 30mm tall, set Header Spacing to at least 35mm

# After changing, restart Odoo and regenerate the report

Fix 2: Custom Header/Footer Height








Fix 3: wkhtmltopdf Version Issues

# Certain wkhtmltopdf versions have header/footer rendering bugs

# Check current version:
wkhtmltopdf --version

# Recommended version for Odoo: 0.12.6 (with patched Qt)
# Download from: https://github.com/wkhtmltopdf/packaging/releases

# Install on Ubuntu:
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
sudo apt install -f ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb

# Verify:
wkhtmltopdf --version
# Should show: wkhtmltopdf 0.12.6 (with patched qt)

Fix 4: Header Not Repeating on All Pages






    
        
            

Fix 5: Table Headers Not Repeating


Description Quantity Price

Fix 6: CSS Page Break Control


Fix 7: Debug Report Rendering

# View the HTML before PDF conversion:
# Add ?debug=1 to the URL when previewing the report
# Or: Print > Print to HTML (not PDF)

# Generate PDF from command line for testing:
wkhtmltopdf --margin-top 40 --margin-bottom 30 \
  --header-spacing 35 \
  /tmp/report.html /tmp/report.pdf

Prevention

DeployMonkey's AI agent validates report layouts and paper format configurations. The agent tests PDF rendering with the correct wkhtmltopdf version and detects header/footer overlap issues before reports go to production.