PDF Template - Background Image Error

Hi

I have added a background image to a PDF Template sample, on the SuiteCRM interface the image is shown and looks fine but when the PDF file is downloaded the background image doesn’t appear.

I have added the image as following:

Regards

Hi berriop,

Have you read the mPDF manual? This may help you solve your issue.

Thanks,

Will.

Hi Will

I have read the mPDF manual and I can see that background images are supported: http://mpdf1.com/manual/index.php?tid=384

“mPDF supports most CSS properties to control background-images…”
“Background-images support JPG, GIF, PNG, WMF and SVG images.”

I cannot figure out how to get the image on the PDF, do I have to make any change on the code?

Thanks

Hi berriop,

Have you tried background-image instead of simply background? When changing it to background-image, please specify a background with a colour, i.e. white(#ffffff) as sometimes background-images won’t work unless a background property is specified before it.

Is the link to the image the true path?

Thanks,

Will.

Hi

Yes, I tried with background-image and its not working, the image doesn’t even appear on the PDF Templates editor.

And yes the image link is the true path, with the “background” property the image is fine on the PDF Templates editor.

Thanks

Hi berriop,

Have you been able to test a normal PDF generated using a standard mPDF setup on your localhost/server? Does this work on mPDF?

Thanks,

Will.

Hi Will

No, I have not try to generate a standard mPDF on my server. I will try it and let you know the results.

Thanks

Hi there,
I had been assigned github issue 54 which addressed this. I have edited the html of the template and added the following surrounding the items:

…The content of your template goes here…

The background image shows correctly in the template and also in the generated pdf document. This has probably been resolved by some work undertaken since the issue was raised.