Upgrade to V1.6 - Logo no longer on PDF

Hi Everyone,

I need some help. After upgrading to V1.6, my PDFs no longer generate with my Logo on them. I did see that this has been resolved in the V1.6-beta2 package (Link) and I’ve upgraded to the V1.6-beta2 release, but still no luck.

I verified that the line in the invoice_helper.php has indeed been changed to the following:

return '<img src="' . base_url() . 'uploads/' . $CI->mdl_settings->setting('invoice_logo') . '" id="invoice-logo">';

I’ve also checked my php error logs, and there is nothing coming up for the logo issue.

Check out the solution in this Pull-request:

Hi @UnderDog, You’ll notice that the Link I posted in my original post is the same link you posted in your reply. I have confirmed that this fix is already in my environment. After updating the .php file, do I need to do anything else for this to work?

Try this solution:

1 Like

putting the logo in pdf in the general setting:

An uncaught Exception was encountered

Type: Mpdf\MpdfImageException

Message: Could not find image file (file:///var/www/vhosts/…
Line Number: 589

Backtrace:

File: /var/www/vhosts/…

Line: 211
Function: imageError

several errors

@alexia74 i’ve moved your problem to this topic

  1. Try the solution from the link to the pull-request
  2. report back if you still have the problem
  3. mention the location of the logo it can’t find

Install beta version and try again.
Of course not on production site

fixed with In version 1.6.0 the logo isn't shown on the PDF by vespino · Pull Request #897 · InvoicePlane/InvoicePlane · GitHub
@UnderDog

3 Likes

Hi @UnderDog, I can confirm that changing it to this solved the issue:

On line 22 to 24:

if ($CI->mdl_settings->setting('invoice_logo')) {
		return '<img src="' .  base_url() . '/uploads/' . $CI->mdl_settings->setting('invoice_logo') . '">';
    }

On line 39 to 42:

if ($CI->mdl_settings->setting('invoice_logo')) {
		$absolutePath = dirname(dirname(__DIR__));
		return '<img src="' . $absolutePath . '/uploads/' . $CI->mdl_settings->setting('invoice_logo') . '" id="invoice-logo">';
    }

Thanks for the assistance.

thanks @UnderDog

Actually, no! I made the mistake of using the $absolutePath = dirname(dirname(__DIR__)); in lines 22 to 25, which is incorrect - This breaks the image on the Guest URLs.

The function invoice_logo() should remain with the base_url() to render that correctly, but the invoice_logo_pdf() should contain the $absolutePath.

I’ll be editing my original solution file, just so that I don’t cause confusion!

2 Likes

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