Generate .PDF Error 502/504 Gateway Time-out

Invoiceplane v 1.5.11
PhP versions (tried) 7.1 / 7.2 / 7.3 and 7.4

Problem:
After updating invoice plane i get the following error if i want to download a invoice/quote. Same error exists with a fresh new install and new database.

Webconsole error:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

Error log:

<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

DEBUG - 2020-08-30 12:16:50 --> UTF-8 Support Enabled
DEBUG - 2020-08-30 12:16:50 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2020-08-30 12:16:50 --> Invoices MX_Controller Initialized
DEBUG - 2020-08-30 12:16:50 --> Config file loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/config/invoice_plane.php
DEBUG - 2020-08-30 12:16:50 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_settings.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_versions.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2020-08-30 12:16:50 --> Layout MX_Controller Initialized
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_items.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_invoice_tax_rates.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_custom_fields.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/payment_methods/models/Mdl_payment_methods.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/payments/models/Mdl_payments.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_invoice_custom.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_values/models/Mdl_custom_values.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_client_custom.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_user_custom.php
DEBUG - 2020-08-30 12:16:50 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/views/invoice_templates/pdf/InvoicePlane.php
DEBUG - 2020-08-30 12:17:20 --> UTF-8 Support Enabled
DEBUG - 2020-08-30 12:17:20 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2020-08-30 12:17:20 --> Sessions MX_Controller Initialized
DEBUG - 2020-08-30 12:17:20 --> Config file loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/config/invoice_plane.php
DEBUG - 2020-08-30 12:17:20 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2020-08-30 12:17:20 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_settings.php
DEBUG - 2020-08-30 12:17:20 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_versions.php
DEBUG - 2020-08-30 12:17:20 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2020-08-30 12:17:20 --> Layout MX_Controller Initialized
DEBUG - 2020-08-30 12:17:20 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/layout/views/alerts.php
DEBUG - 2020-08-30 12:17:20 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/sessions/views/session_login.php
DEBUG - 2020-08-30 12:17:20 --> Total execution time: 0.0248
DEBUG - 2020-08-30 12:18:11 --> UTF-8 Support Enabled
DEBUG - 2020-08-30 12:18:11 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2020-08-30 12:18:11 --> Sessions MX_Controller Initialized
DEBUG - 2020-08-30 12:18:11 --> Config file loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/config/invoice_plane.php
DEBUG - 2020-08-30 12:18:11 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2020-08-30 12:18:11 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_settings.php
DEBUG - 2020-08-30 12:18:11 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_versions.php
DEBUG - 2020-08-30 12:18:11 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2020-08-30 12:18:11 --> Layout MX_Controller Initialized
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/sessions/models/Mdl_sessions.php
DEBUG - 2020-08-30 12:18:12 --> UTF-8 Support Enabled
DEBUG - 2020-08-30 12:18:12 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2020-08-30 12:18:12 --> Dashboard MX_Controller Initialized
DEBUG - 2020-08-30 12:18:12 --> Config file loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/config/invoice_plane.php
DEBUG - 2020-08-30 12:18:12 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_settings.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_versions.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2020-08-30 12:18:12 --> Layout MX_Controller Initialized
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_invoice_amounts.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/quotes/models/Mdl_quote_amounts.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/quotes/models/Mdl_quotes.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/projects/models/Mdl_projects.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/tasks/models/Mdl_tasks.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/layout/views/alerts.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/dashboard/views/index.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/layout/views/includes/head.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/layout/views/includes/navbar.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/layout/views/includes/fullpage-loader.php
DEBUG - 2020-08-30 12:18:12 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/layout/views/layout.php
DEBUG - 2020-08-30 12:18:12 --> Total execution time: 0.0394
DEBUG - 2020-08-30 12:18:16 --> UTF-8 Support Enabled
DEBUG - 2020-08-30 12:18:16 --> Global POST, GET and COOKIE data sanitized
DEBUG - 2020-08-30 12:18:16 --> Invoices MX_Controller Initialized
DEBUG - 2020-08-30 12:18:16 --> Config file loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/config/invoice_plane.php
DEBUG - 2020-08-30 12:18:16 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_settings.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/settings/models/Mdl_versions.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/controllers/../modules/layout/controllers/Layout.php
DEBUG - 2020-08-30 12:18:16 --> Layout MX_Controller Initialized
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_invoices.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_items.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/invoices/models/Mdl_invoice_tax_rates.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_custom_fields.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/payment_methods/models/Mdl_payment_methods.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/payments/models/Mdl_payments.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_invoice_custom.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_values/models/Mdl_custom_values.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_client_custom.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/modules/custom_fields/models/Mdl_user_custom.php
DEBUG - 2020-08-30 12:18:16 --> File loaded: /home/u9236p8546/domains/naturallyorganix.com/public_html/invoices/application/views/invoice_templates/pdf/InvoicePlane.php

Any help is greatly appreciated!