Error when generating PDF

Any Idea what these errors could be and how to solve them?

A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 0

Filename: src/TTFontFile.php

Line Number: 427

Backtrace:

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 427
Function: _error_handler

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 240
Function: read_ulong

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Fonts/MetricsGenerator.php
Line: 24
Function: getMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3713
Function: generateMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3997
Function: AddFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 12174
Function: SetFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 1389
Function: SetDefaultFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/mpdf_helper.php
Line: 39
Function: __construct

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/pdf_helper.php
Line: 103
Function: pdf_create

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/modules/invoices/controllers/Invoices.php
Line: 280
Function: generate_invoice_pdf

File: /var/www/vhosts/yes.lu/invoice.yes.lu/index.php
Line: 327
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 1

Filename: src/TTFontFile.php

Line Number: 427

Backtrace:

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 427
Function: _error_handler

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 240
Function: read_ulong

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Fonts/MetricsGenerator.php
Line: 24
Function: getMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3713
Function: generateMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3997
Function: AddFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 12174
Function: SetFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 1389
Function: SetDefaultFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/mpdf_helper.php
Line: 39
Function: __construct

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/pdf_helper.php
Line: 103
Function: pdf_create

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/modules/invoices/controllers/Invoices.php
Line: 280
Function: generate_invoice_pdf

File: /var/www/vhosts/yes.lu/invoice.yes.lu/index.php
Line: 327
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 2

Filename: src/TTFontFile.php

Line Number: 427

Backtrace:

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 427
Function: _error_handler

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 240
Function: read_ulong

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Fonts/MetricsGenerator.php
Line: 24
Function: getMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3713
Function: generateMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3997
Function: AddFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 12174
Function: SetFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 1389
Function: SetDefaultFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/mpdf_helper.php
Line: 39
Function: __construct

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/pdf_helper.php
Line: 103
Function: pdf_create

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/modules/invoices/controllers/Invoices.php
Line: 280
Function: generate_invoice_pdf

File: /var/www/vhosts/yes.lu/invoice.yes.lu/index.php
Line: 327
Function: require_once

A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 3

Filename: src/TTFontFile.php

Line Number: 427

Backtrace:

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 427
Function: _error_handler

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php
Line: 240
Function: read_ulong

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Fonts/MetricsGenerator.php
Line: 24
Function: getMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3713
Function: generateMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3997
Function: AddFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 12174
Function: SetFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 1389
Function: SetDefaultFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/mpdf_helper.php
Line: 39
Function: __construct

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/pdf_helper.php
Line: 103
Function: pdf_create

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/modules/invoices/controllers/Invoices.php
Line: 280
Function: generate_invoice_pdf

File: /var/www/vhosts/yes.lu/invoice.yes.lu/index.php
Line: 327
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/codeigniter/framework/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 564

Backtrace:

An uncaught Exception was encountered

Type: Mpdf\MpdfException

Message: Not a TrueType font: version=0

Filename: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/TTFontFile.php

Line Number: 252

Backtrace:

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Fonts/MetricsGenerator.php
Line: 24
Function: getMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3713
Function: generateMetrics

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 3997
Function: AddFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 12174
Function: SetFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/vendor/mpdf/mpdf/src/Mpdf.php
Line: 1389
Function: SetDefaultFont

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/mpdf_helper.php
Line: 39
Function: __construct

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/helpers/pdf_helper.php
Line: 103
Function: pdf_create

File: /var/www/vhosts/yes.lu/invoice.yes.lu/application/modules/invoices/controllers/Invoices.php
Line: 280
Function: generate_invoice_pdf

File: /var/www/vhosts/yes.lu/invoice.yes.lu/index.php
Line: 327
Function: require_once

Which language do you use for your InvoicePlane interface?

Hello,

I used french as language and now I switched to english but the error occured again.

Is that a fresh install of Invoice Plane? Which version is it?
Do you have custom fields?
Can you try changing the TTFontFile.php file’s charset (with your text editor) from UTF-8 to something else?

Hello,

Yes it’s a fresh installation of invoice plane.
It’s the last available version.

What I have done is:

  • download the installer file on my windows 10 machine
    unzip the file
    copy it through ftp to my linux server
    run the installer
    configured the software
    Made some tests and found out that everything was working except this part.

Do you think I should use another format of mysql database with a different charset?
I use utf8_general_ci

Thank you

No, I was talking about the file’s charset, not your database’s charset (utf8_general_ci is good).
Your fonts might be corrupted, try to re-upload following folder: /vendor/mpdf/mpdf/ttfonts. There should be .tff files over 100KB there.
Make it chmod 777 if it still does not work.
I have no other clue.

Wowwwww, excellent.
You’re something like God now for me.

It works after uploading again that part.