PDF Background not working following site move



I am experiencing a very strange problem. I have a background image on my PDF’s, which has worked well on 1.4x and 1.5x. to achieve this, I have always had to modify/assets/invoiceplane/css/templates.css. The image file a4png lives at /assets/invoiceplane/css/.

My invoiceplane installation has lived at https://subdomain.domain.tld/invoice/ and all works well. I am now retiring the subdomain, and want to access invoiceplane at the new address, https://domain.tld/ip/. Everything works, except the PDF background. It just will not display!

the image is accessible at the expected new location, https://domain.tld/ip/assets/invoiceplane/css/a4/png in a browser, however the application is unable to find the image. When I turn on debugging, I receive the following error:

An uncaught Exception was encountered
Type: Mpdf\MpdfImageException
Message: Could not find image file (https://domain.tld/assets/invoiceplane/css/a4.png)
Filename: /path/to/web/root/ip/vendor/mpdf/mpdf/src/Image/ImageProcessor.php
Line Number: 1333
_backtrace copied at end_

I have tried a completely fresh installation of IP, I’ve tried cloning the old site to the new location and modifying the ipconfig.php as necessary. The sub-domain and tld are running on the same server. The only differences are the apache VirtualHost.

Any ideas?


File: /path/to/web/root/ip/vendor/mpdf/mpdf/src/Image/ImageProcessor.php
Line: 207
Function: imageError

File: /path/to/web/root/ip/vendor/mpdf/mpdf/src/Mpdf.php
Line: 8518
Function: getImage

File: /path/to/web/root/ip/vendor/mpdf/mpdf/src/Mpdf.php
Line: 2121
Function: Image

File: /path/to/web/root/ip/vendor/mpdf/mpdf/src/Mpdf.php
Line: 14607
Function: SetBackground

File: /path/to/web/root/ip/application/helpers/mpdf_helper.php
Line: 88
Function: WriteHTML

File: /path/to/web/root/ip/application/helpers/pdf_helper.php
Line: 257
Function: pdf_create

File: /path/to/web/root/ip/application/modules/quotes/controllers/Quotes.php
Line: 207
Function: generate_quote_pdf

File: /path/to/web/root/ip/index.php
Line: 327


First, there is a special file called custom-pdf.css that should be used to modify any styles for templates.

About the image: https://domain.tld/ip/assets/invoiceplane/css/a4/png and https://domain.tld/assets/invoiceplane/css/a4.png are not the same for me.


Thanks, Kovah.

a4/png was a typo. That should have read a4.png.

I should have also mentioned that I have been unable to get the custom-pdf.css to override the background on PDF invoices, hence diving into the parent code to rule out an issue with that file. custom-pdf.css has been tried with the following code:

    margin:0 auto;color:#3A3A3A;
    background: url("a4.png") repeat right bottom fixed;

This produces exactly the same error as listed in my original post. I have also tried fully qualified addresses in the url() with both the custom-pdf.css and templates.css. I have also tried ../../../uploads/a4.png to retrieve the file from the uploads directory (that location is also accessible directly using the browser).

It is working fine for my original install at subdomain.domain.tld/invoice/, and also on a customers site. It is stubbornly failing on the new domain.tld address.