MPDF Generation Suddenly No Longer Working

Hello all,

I was hoping someone might have some insight into some errors I am seeing. PDF generation was working fine on our production box and then suddenly stopped working. To my knowledge nothing has been updated on the box that should have caused it to break. The error that I see has to do with a font file not loading I think. I have verified that the files do still exist in those locations. I am at a loss. Any help would be much appreciated. The relevant errors are below:

ERROR - 2017-05-09 15:17:45 --> Severity: Warning  --> include(/var/www/html/invoiceplane/uploads/temp/mpdf/dejavusanscondensed.GDEFdata.php): failed to open stream: No such file or directory /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 101
ERROR - 2017-05-09 15:17:45 --> Severity: Warning  --> include(): Failed opening '/var/www/html/invoiceplane/uploads/temp/mpdf/dejavusanscondensed.GDEFdata.php' for inclusion (include_path='.:/usr/share/php') /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 101
ERROR - 2017-05-09 15:17:45 --> Severity: Warning  --> file_get_contents(/var/www/html/invoiceplane/uploads/temp/mpdf/dejavusanscondensed.GSUBGPOStables.dat): failed to open stream: No such file or directory /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 295

The full block of error code is below. As stated, I believe the errors about undefined variables are all dependent upon the files not loadingā€¦but just in case it is helpful.

ERROR - 2017-05-09 15:17:45 --> Severity: Warning  --> include(/var/www/html/invoiceplane/uploads/temp/mpdf/dejavusanscondensed.GDEFdata.php): failed to open stream: No such file or directory /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 101
ERROR - 2017-05-09 15:17:45 --> Severity: Warning  --> include(): Failed opening '/var/www/html/invoiceplane/uploads/temp/mpdf/dejavusanscondensed.GDEFdata.php' for inclusion (include_path='.:/usr/share/php') /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 101
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GSUB_offset /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 102
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GPOS_offset /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 103
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GSUB_length /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 104
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: MarkAttachmentType /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 105
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: MarkGlyphSets /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 106
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GlyphClassMarks /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 107
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GlyphClassLigatures /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 108
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GlyphClassComponents /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 109
ERROR - 2017-05-09 15:17:45 --> Severity: Notice  --> Undefined variable: GlyphClassBases /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 110
ERROR - 2017-05-09 15:17:45 --> Severity: Warning  --> file_get_contents(/var/www/html/invoiceplane/uploads/temp/mpdf/dejavusanscondensed.GSUBGPOStables.dat): failed to open stream: No such file or directory /var/www/html/invoiceplane/vendor/kovah/mpdf/classes/otl.php 295

I guess you are using an older version than 1.5.0, right?
Unfortunately I do not update this older version of mPDF that was managed via my personal account.

You may ask the guys of mPDF directly about this problem. GitHub - mpdf/mpdf: PHP library generating PDF files from UTF-8 encoded HTML

Yes. We have not upgraded to 1.5 yet. I was waiting until the end of the school year for that. I will ask on the mPDF forums. It is very strange that it just quit working randomly.

Do you believe updating to the 1.5 version of Invoiceplane might fix it?

Kovah,

Thanks for the help earlier. I have not made any progress with mpdf yet but I decided to upgrade to 1.5.2 to see if the issue persisted. I am now getting php errors with my custom fields. I had previously customized the display page for invoices and quotes, adding a new column to the partial_quote_table.php file for ā€œstudent nameā€ which was a quote custom field. I looked at the wiki for the new way to pull the field but I keep getting an error
Undefined variable: custom_fields

This is the old way I was including the field in the display before and it worked
<?php echo $quote->quote_custom_student_name; ?>

This is how I am trying to echo the field to the displayā€¦
<?php echo $custom_fields['quote']['Student Name']; ?>

Any thoughts? Are the custom fields still available to pull and include in the display tables?
Thanks!

I just donā€™t understand how this can happen. The variable is defined in the source code and is available in all included PDF templatesā€¦
And I do not understand how <?php echo $quote->quote_custom_student_name; ?> is working as this is throwing me an Undefined property error.

My apologies.

<?php echo $quote->quote_custom_student_name; ?> was working prior to upgrading to 1.5.2. Previously we were running 1.4.7 (or something like that) and that is when that particular code was working.

The new way of pulling it <?php echo $custom_fields['quote']['Student Name']; ?> will most likely work in the pdf templates. I have not tried it there yet. I was actually modifying the partial_quote_table.php file located at application>modules>quotes>views>partial_quote_table.php. The old way of using the variable was working there, again prior to upgrading. The old way on the upgraded 1.5.2 version throws and undefined variable. Using the new way of pulling the variable results in the undefined variable error. Are the variables available in these files if one wants to modify them? Is there something I would have to code in elsewhere to make them available? We are using the invoicing program for tracking inventory and damages to student iPads. I added the custom field ā€˜student nameā€™ to the partial quote table previously to make searching easier for our staff.

No, as fas as i remember, custom fields are only in the quotes itself as the new, extended way of managing custom fields would make the quote page load horribly slow as the system would have to fetch all custom fields with their values for each quote.

Thank you for this information. I will see if there is a way I can dynamically pull just the info I need at some point. In the meantime, I have fixed the original issue. Turns out the box that InvoicePlane was running on was upgraded to a new Linux Kernel. The new Kernel caused random smb mounts to unmount. We have our uploads folder pointed at a smb mount. My best guess is that the disk unmounted in middle of a pdf generation and the temporary mpdf files in the error messages became corrupted. I deleted all of those files and now PDF generation is working again.

On a different noteā€¦Thank you for all of the development that has gone into this application. It is very user friendly and useful. I think it is one of the best invoicing systems I have seen.

1 Like