Common PDF Generation Issues
| Symptom | Cause |
|---|---|
| Blank PDF | wkhtmltopdf not installed or wrong version |
| Report times out | wkhtmltopdf hanging on external resources |
| Error: "Report not found" | Report action or template missing |
| Missing CSS/images in PDF | wkhtmltopdf cannot access Odoo static files |
| Incorrect layout/sizing | Wrong paper format or QWeb template issues |
Fix 1: Install the Correct wkhtmltopdf Version
Odoo requires a specific patched version of wkhtmltopdf (with Qt patches for headers/footers).
# Check current version
wkhtmltopdf --version
# Required: 0.12.6 (patched)
# Download from: https://github.com/wkhtmltopdf/packaging/releases
# Ubuntu 22.04 / Debian 12:
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 -y ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb
# Verify
wkhtmltopdf --version
# Should show: wkhtmltopdf 0.12.6 (with patched qt)Warning: The unpatched version from apt (apt install wkhtmltopdf) does NOT support headers and footers. You must install the patched version from the GitHub releases page.
Fix 2: PDF Timeouts
# Increase timeout in odoo.conf
limit_time_real = 300 # 5 minutes for large reports
# Or fix the root cause — wkhtmltopdf hanging on external resources:
# Add to wkhtmltopdf options:
# --no-stop-slow-scripts
# --load-error-handling ignoreFix 3: Missing Images/CSS in PDF
wkhtmltopdf fetches static files from Odoo as an HTTP client. If it cannot reach Odoo:
# Check if Odoo is accessible from localhost
curl -I http://localhost:8069/web/static/src/img/logo.png
# If behind nginx, ensure localhost:8069 is accessible
# Or set report_url in odoo.conf:
report_url = http://localhost:8069Fix 4: Docker-Specific Issues
# In Docker, wkhtmltopdf may need additional dependencies:
RUN apt-get update && apt-get install -y \
libxrender1 libfontconfig1 libxext6 \
xfonts-75dpi xfonts-base
# The official Odoo Docker image includes wkhtmltopdf
# If using a custom image, install the patched versionFix 5: Paper Format
# Check paper format in Settings → Technical → Reporting → Paper Format
# Common settings:
# A4: 210mm × 297mm (Europe, most of world)
# Letter: 215.9mm × 279.4mm (US, Canada)
# Margins: top 40mm, bottom 20mm, left 7mm, right 7mmDebugging PDF Generation
# Generate PDF from command line to see errors:
wkhtmltopdf --debug-javascript http://localhost:8069/report/html/sale.report_saleorder/1 test.pdf
# Check Odoo logs for report errors:
grep -i "report\|wkhtmltopdf\|pdf" /var/log/odoo/odoo.log | tail -20DeployMonkey
DeployMonkey includes the correct wkhtmltopdf version pre-installed. PDF reports work out of the box on all plans.