Company Logo not display within invoice

Hi,

I have spent many hours trying many things to get our company logo to display in the invoice.

The logo appears everywhere throughout the application perfectly just not within the invoice.

Logo type is png and size is 200 x 65.

Version 4.x has never been an issue for us.

Any assistance would be very much appreciated.

Version is 5.0.25-release

Cheers

Here is image display logos correctly;

Hi,

You may need to run php artisan storage:link

Or, if you’re using Docker: sudo docker-compose exec app php artisan storage:link

Hi Hillel,

Yes, I have already tried “php artisan storage:link” several times and rebooted server several times and still no luck.

We are not using docker installation.

Is there a log file I can review to identify the issue?

Cheers

The log file is in storage/logs/

Already search there and no assistance, below is extract;

[2020-11-22 05:35:21] production.INFO: POST - https://xxx.xxx.xx/api/v1/preview: 51 queries - 4.2540109157562
[2020-11-22 05:35:33] production.INFO: POST - https://xxx.xxx.xxapi/v1/preview: 51 queries - 4.1497859954834

Maybe its impossible to find the issue…

I might be wrong here but seems to me to be an issue finding image via pdf building only???

Cheers

Hi @geoff the PDF generator relies on images being resolvable by its URL, We’ve seen this issue when people are running InvoiceNinja on their local PC’s / behind a proxy/firewall and their DNS resolvers are not able to resolve the file locally.

@ben this issue has cropped up again, did we have a fix for this merged? or pending?

1 Like

Hi David,

Yes, the server is behind a firewall. Although rest of the app has no issue resolving FQDN.

Is app building pdf on the client or server side rendering?

We have 2 DNS server one external facing and one internal only facing, this could be the issue?

Cheers

Hi David,

After some more analysis, I can confidently confirm that it is not a DNS issue nor a firewall issue. I can successfully load image using FQDN/storage/xxxxx/xxxx.png

Where else should I look to resolve this issue?

Cheers

Hi David,

Which source file generates the PDF, as I would like to assist with resolution of this issue?

Cheers

Hey @geoff, I’ll test this on my non-Docker installation today & will get back to you regarding this.

Thank you for reporting!

Hi @ben,
Many thanks and appreciate your kind assistance.
Cheers

Hey @geoff,

I’ve just tested the latest v5 and seems I can’t recreate the issue. Have you tried a different design?

Here are my two attempts running on Ubuntu 20.04:

Here’s how you can debug it:

Navigate to: app/Jobs/Entity/CreateEntityPdf.php

Add this after line 154:

info($maker->getCompiledHTML());

… so your code looks like this:

        try {
            $pdf = $this->makePdf(null, null, $maker->getCompiledHTML(true));
            info($maker->getCompiledHTML());
        } catch (\Exception $e) {
            info(print_r($e->getMessage(), 1));
        }

After that, clear logs:

You can completely remove storage/logs/laravel.log file.

Now, just generate new invoice or modify the current one. After generating you should see HTML in laravel.log. If you’re not familliar with that, that’s fine, send that log file in private messages on forum or on ben[at]invoiceninja.com and I’ll check it for you.

In case you’re using database/redis queue driver, please execute following command:

php artisan queue:restart

To find out what driver you use:

  1. Open .env file (in root of Invoice Ninja folder)
  2. Check value of QUEUE_CONNECTION

Thanks!

Hi @ben,
Yes, behaviour is exactly the same for me, no issue using default invoice ninja logo, once you update company details with logo them image does not display but alt tag value does.

I can only assume within you code you are using base64 and not an image because I replaced all ninja invoice images with different one and in most places within the application the logo changed as expected except generating the invoice pdf. Thus my request to review code to identify the issue.
Cheers

Hi @ben,
Many thanks for you update.
I followed you steps exactly and still the same issue, plus once I remove company logo from details section invoice pdf work perfectly with invoice ninja logo.

I will try and send log file to you.

Also note that my .env is very spartan compared to .env.example and their was no entry for QUEUE_CONNECTION…could this have an impact?
Cheers

Hi @ben,

[2020-11-25 18:41:27] production.INFO: GET - https://xxx.xxx.xxx: 1 queries - 1.2907249927521
[2020-11-25 18:41:30] production.INFO: GET - https://xxx.xxx.xxx: 1 queries - 0.27939414978027
[2020-11-25 18:41:58] production.INFO: POST - https://xxx.xxx.xxx/api/v1/login: 55 queries - 0.37303686141968
[2020-11-25 18:42:20] production.INFO: POST - https://xxx.xxx.xxx/api/v1/preview: 41 queries - 6.2074179649353
[2020-11-25 18:45:16] production.INFO: POST - https://xxx.xxx.xxx/api/v1/preview: 41 queries - 4.2777519226074
[2020-11-25 18:45:48] production.INFO: PUT - https://xxx.xxx.xxx/api/v1/companies/VolejRejNm: 11 queries - 0.051152944564819
[2020-11-25 18:45:57] production.INFO: POST - https://xxx.xxx.xxx/api/v1/preview: 41 queries - 4.2948679924011
[2020-11-25 18:48:40] production.INFO: PUT - https://xxx.xxx.xxx/api/v1/companies/VolejRejNm: 11 queries - 0.059583902359009
[2020-11-25 18:48:43] production.INFO: PUT - https://xxx.xxx.xxx/api/v1/companies/VolejRejNm: 11 queries - 0.02413010597229
[2020-11-25 18:48:54] production.INFO: POST - https://xxx.xxx.xxx/api/v1/preview: 41 queries - 4.2240731716156
Cheers

Hi @ben,
Copied .env.example setting to .env.

Now log has the following;
[2020-11-25 19:59:10] production.INFO: MNIGn1ymACjbmdvMpxSqBrYGYLT7GTNPxLx88OwnVZzgm3FUyBZaEufbgZCD1Oc2/zfHA0RvoZxP04npYajTbuo8bwvIFg2qrJvS0Ha2t.png
[2020-11-25 19:59:10] production.INFO: 51c8d1d940db05739c4c4b149c4018cf24048529.png
[2020-11-25 19:59:10] production.INFO: the path /storage/MNIGn1ymACjbmdvMpxSqBrYGYLT7GTNPxLx88OwnVZzgm3FUyBZaEufbgZCD1Oc2/zfHA0RvoZxP04npYajTbuo8bwvIFg2qrJvS0Ha2t.png

When I put domain url in front of /storage/…/…png the logo/image displays perfectly just not in the pdf.
Cheers

Hi @ben and team,

We’ve use v4.5 with white-labelling successfully for over a year with an associated company and have never had a requirement to contact Invoice Ninja.

We only considering implementing with v5 because we received an email stating there was a stable release ready to use.

My experiences to-date are that this version is not stable and is not ready for production use and has a long way to go before it is.

I’ve seen a lot of comments saying bad things but to be honest, I personally like what you guys have done to-date, the item I give a big tick too is customising CSS for invoices, soooooo much better than previous versions.

The use of Material Design & Tailwinds is a great decision. My only criticism is too many frameworks/plugins being used and you’ve dive too much into the technology and forgotten about the basics plus the KISS theory.

From my prospective the 2 must have before any other functionality is white-labelling and invoices with our companies logo, sadly neither of these features are working with v5.

We have strong Java, Python and Javascript skills but very poor PHP and therefore are unable to assist and contribute to your great work.

Also note, that we had about 8 attempt trying to standup a Redhat version of v5 and then gave up, had 2 more goes with Debian 10 and finally got a working environment.

Sorry for long winded message, all the best with the future development of v5 but we are calling it a day as it’s became mission impossible for us.

Cheers
Geoff

Hi,

v5 is currently a “stale release candidate”, if the only serious issues you’re seeing are the logo and white labelling then I think we got the label just right. I’m sure we’ll have those issues resolved for our official stable release.

Can you explain what you mean by “you’ve dive too much into the technology and forgotten about the basics plus the KISS theory”. It’s a vey general statement, it would be helpful if you could provide specifics.

We’re using Flutter to build the admin portal. The tech is still very new and has some compromises on web but (a) it will improve over time and (b) the fact that it enables us to provide web, iOS, Android, Windows, Linux and macOS apps with one codebase in my opinion make it the best choice for our app/team.

Thanks for your feedback!

1 Like