mPDF failed to load PDF document

Invoiceplane version 1.5.9
ubuntu 18.4
php 7.2
all prerequisites packages installed

After installing invoiceplane version1.5.9, mPDF occured a PHP error and display a black screen with a popup “Failed to load PDF document”

See below error code

A PHP Error was encountered
Severity: Notice

Message: Undefined index: host

Filename: src/CssManager.php

Line Number: 2229


File: /var/www/html/portail/renelsales/vendor/mpdf/mpdf/src/CssManager.php
Line: 2229
Function: _error_handler

File: /var/www/html/portail/renelsales/vendor/mpdf/mpdf/src/CssManager.php
Line: 148
Function: _get_file

File: /var/www/html/portail/renelsales/vendor/mpdf/mpdf/src/Mpdf.php
Line: 14710
Function: ReadCSS

File: /var/www/html/portail/renelsales/application/helpers/mpdf_helper.php
Line: 97
Function: WriteHTML

File: /var/www/html/portail/renelsales/application/helpers/pdf_helper.php
Line: 258
Function: pdf_create

File: /var/www/html/portail/renelsales/application/modules/quotes/controllers/Quotes.php
Line: 193
Function: generate_quote_pdf

File: /var/www/html/portail/renelsales/index.php
Line: 325
Function: require_once```

Hi guy’s
I found this in another issue and it’s run now.

Open this file /application/helpers/mpdf_helper.php and change
$mpdf->WriteHTML((string) $html);
error_reporting(E_ALL & ~E_NOTICE);
$mpdf->WriteHTML((string) $html);

You can close this

This actually is just bypassing the real issue.

If you google for

The first result is this:

There is stated that your HTML Document most probably is not formed well and mPDF most probably can not work with some of the use CSS/HTML parts.
This is happening in Line 2229 so pls just double check everything there is working fine

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.