Table of Contents
-
Introduction
-
Common Symptoms of PDF Display Issues
-
How Dolibarr Generates PDF Documents
-
Key Modules Involved in PDF Creation
-
Confirming Your Dolibarr Version and PHP Compatibility
-
Server Requirements and PDF Dependencies
-
Common Causes of PDF Rendering Failures
-
Checking for PHP Library Issues (TCPDF/FPDF)
-
Diagnosing File Permission Problems
-
Corrupted or Missing PDF Template Files
-
Error Logs: How to Locate and Interpret Them
-
Solving White Screen or Empty PDF Output
-
Issues with Custom or Third-Party PDF Templates
-
Fixing Problems After a Dolibarr Update or Migration
-
Recommended PHP Settings for PDF Generation
-
Updating TCPDF Manually (if needed)
-
Using Dolibarr Debug Mode to Identify Errors
-
Reinstalling or Repairing the PDF Core Module
-
Using System Utilities to Test PDF Output Outside Dolibarr
-
Conclusion and Long-Term Best Practices
1. Introduction
If your PDFs are no longer displaying in Dolibarr as expected—whether in invoices, proposals, delivery slips, or quotes—you are not alone. PDF generation issues are among the most common support requests in Dolibarr forums, especially after system updates or migrations.
This guide will walk you through identifying and solving the root causes of PDF rendering problems in Dolibarr ERP, with a specific focus on changes observed in 2025.
2. Common Symptoms of PDF Display Issues
-
Clicking "Generate PDF" does nothing
-
White screen on PDF generation
-
File downloads but is corrupted or blank
-
Error message such as "TCPDF error" or "Cannot open file"
-
Only partial content shown in generated PDFs
3. How Dolibarr Generates PDF Documents
Dolibarr uses PHP-based libraries (primarily TCPDF) to generate dynamic PDF content for modules like:
-
Invoices
-
Orders
-
Proposals
-
Contracts
-
Shipping
These documents are built from templates located in /core/modules/.../doc/
.
4. Key Modules Involved in PDF Creation
-
TCPDF library (bundled with Dolibarr)
-
PDF model files (e.g.,
pdf_crabe.modules.php
) -
Document generation scripts (
builddoc.php
) -
Upload and temp folders (
/documents/
)
5. Confirming Your Dolibarr Version and PHP Compatibility
In 2025, Dolibarr supports PHP 8.1 and above. Incompatibility between your Dolibarr version and the active PHP version may break PDF features. Always verify:
-
Dolibarr version under Home > About
-
PHP version via a
phpinfo()
script or hosting dashboard
6. Server Requirements and PDF Dependencies
Ensure your server meets Dolibarr’s PDF generation requirements:
-
GD library
-
zlib
-
mbstring
-
fileinfo
-
Safe mode OFF (for older PHP setups)
7. Common Causes of PDF Rendering Failures
-
Missing or outdated TCPDF library
-
Corrupt template file in
/doc/
-
PHP memory limits too low
-
Conflicting third-party modules
-
Web server permissions preventing file write
8. Checking for PHP Library Issues (TCPDF/FPDF)
TCPDF issues often appear after updates. Check:
-
/includes/tcpdf/tcpdf.php
is present and unmodified -
No fatal errors in
dolibarr.log
-
No PHP notices on deprecated TCPDF methods
9. Diagnosing File Permission Problems
Ensure the Dolibarr documents
directory and its subfolders:
-
Exist
-
Are writable by the web server user (e.g.,
www-data
)
Use:
chmod -R 755 htdocs/documents
chown -R www-data:www-data htdocs/documents
10. Corrupted or Missing PDF Template Files
-
Go to Setup > Modules > Invoices > Configure
-
Switch to another template (e.g., from Azur to Crabe)
-
Check if the issue persists
Missing or modified pdf_*
files can break generation.
11. Error Logs: How to Locate and Interpret Them
Enable debug mode:
-
Edit
conf.php
-
Set
$dolibarr_main_prod = 0;
-
Review
/dolibarr/documents/dolibarr.log
or web server logs
Look for PHP Fatal errors or missing function messages.
12. Solving White Screen or Empty PDF Output
-
Increase memory_limit in
php.ini
-
Check that all mandatory fields are filled (e.g., company name, address)
-
Switch templates to rule out custom bugs
13. Issues with Custom or Third-Party PDF Templates
Custom templates often break after Dolibarr version upgrades. Fix:
-
Compare with official templates
-
Replace deprecated TCPDF methods
-
Reinstall base templates if unsure
14. Fixing Problems After a Dolibarr Update or Migration
-
Recopy missing or overwritten files
-
Clear browser and Dolibarr caches
-
Check PHP version compatibility
15. Recommended PHP Settings for PDF Generation
Ensure:
-
memory_limit = 256M
-
max_execution_time = 60
-
file_uploads = On
-
upload_max_filesize = 20M
16. Updating TCPDF Manually (if needed)
-
Download latest TCPDF from GitHub
-
Replace contents in
/includes/tcpdf
-
Test PDF output again
Caution: Custom templates may need to be adapted to match updated TCPDF versions.
17. Using Dolibarr Debug Mode to Identify Errors
-
Navigate to Admin > Modules > Debug Tools
-
Enable error logging to screen
-
Retry PDF generation and capture the error details
18. Reinstalling or Repairing the PDF Core Module
To reset default PDF modules:
-
Deactivate module (e.g., Invoices)
-
Reupload original
/doc/
folder templates -
Reactivate the module
19. Using System Utilities to Test PDF Output Outside Dolibarr
To rule out external causes:
-
Create a standalone TCPDF PHP file to generate a PDF
-
Test PDF rendering independently from Dolibarr
-
Use tools like
wkhtmltopdf
as fallback if needed
20. Conclusion and Long-Term Best Practices
To avoid recurring PDF issues in Dolibarr:
-
Keep your version updated
-
Backup your custom templates
-
Monitor compatibility after every upgrade
-
Use standard templates when troubleshooting
By following this 2025-focused troubleshooting guide, you can confidently diagnose and resolve PDF issues in Dolibarr and maintain smooth document generation for your business workflows.