I have a html img balise inside my template for my logo.
But since my last IP update from 1.5.x to 1.6, the image loaded by html are not working anymore inside the generated pdf :
I had applied the PR but it doesn’t solved the problem.
The point is my html code doesn’t use the uploaded logo (from the settings), but just an image hosted on the server.
I tried this code instead my initial one (see first post) :
I looked the both PR but I’m insisting : they both concern the system settings for the logo (inside a helper function), but in my case, I just want to insert it with absolute path on the php template’s file.
On my “Invoice template.php” file I have this html code :
Hi @Spheerys, are you maybe using an absolute path to load an asset that is on the same domain as InvoicePlane is? In this case you might want to check that your server can resolve your domain to localhost. To do so, you might try to ping your own domain from the server console. Ideally for assets on the server you should use a relative path, since mpdf generates the files server side.
Maybe I can give some general tips here on what I do to see the correct urls (or other difficulties) related to mpdf…
I simply take the piece of code with the problem from my template “pdf/InvoicePlane.php” file and put it in “public/InvoicePlane_Web.php”.
E.g.:
Then I use a “webdev tool” to look at the code to see what my browser makes of this.
Here are some more possibilities you can test:
If you have a local web server set up you can also try removing the “s” of http(s) from your absolute path.
So <img src="http://mydomain.fr/assets/default/img/logo-blanc.png" alt="" />test.
If you use the function invoice_logo_pdf() test if invoice_logo() works in your template.
In fact, the id “invoice_logo” in the invoice_logo_pdf() function should be id=“logo”.
Thanks a lot for your both answers @VeRony and @naui95
Unfortunately, I give up (for now) and I replace my nice logo by simply text…
I don’t have enough time and courage to investigate furthermore for the moment