PDF Quotation Template - Broken Images

Hello Everyone,

Iā€™ve been working on a custom quote template for my company. I started by loading the ā€œQuote Sampleā€ and modifying from there.

I changed the picture from the SuiteCRM logo to our company logo. The logo is displaying just fine in the PDF Template editor but when I try to ā€œPrint to PDFā€ a test quote the image shows as broken (red X) in the PDF itself.

Does anyone know what might be causing this?

Thanks,
Kevin

from the PDF template right click the image and get the URL for it. Are there any Spaces in the name or path?

Also see if you can get image information from the PDF. This depends on your viewer.

Post your results hereā€¦

Thanks

Hey, this is an old thread, but if others have this issue, I had this broken image in PDF templates and was able to fix it:
-make sure the image is in a writeable directory on the same server as your SuiteCRM install, not a link to an external website/ server (eg localhost/uploads/)
-make sure the image itself has the correct permissions. Iā€™ve reapplied permissions countless times on our server, but a logo uploaded via FTP still had the default 644 file permissions. Change permission on the image to 775.
-use a relative path in the HTML link to the image, eg

Hope that helps.

1 Like

HI Dylan,

thank youā€¦ had a huge problem with adding images to pdf templatesā€¦for me I had to upload image to the main directory of my SuiteCRM installation

and then I could use the ā€œadd imageā€ button, but just enter the filename, no /

that was the only thing that worked for me

I could though add logos from other websites with http://image-location

I was not able to upload images from google drive though

Hope this helps someone, after I sopent hours trying stuff :slight_smile:

Best D

1 Like

Thanks I solved with your suggestion in version 7.11.18

So, to add image to pdf template; first we need to upload image to our CRM server and then provide image URL?

image

Yes, exactly.
So the PDF engine can load the file from the local server.

If you check the HTML of the sample, youā€™ll see how itā€™s being done in the standard:

I usually create one separate folder for an own logo and some other graphics like certificates etc. if needed and then include them from the separate folder.

If that should not work right away, there are a few settings in PHP / Apache to restrict loading images / remote images and similar.

1 Like

I donā€™t know, why it is not working for me. I have added image URL like you and tried but it is showing just :negative_squared_cross_mark: icon in the PDF.

Then I tried below and also only with http, then when I clicked on Generate PDF, system went into buffering mode(got very slow) and it did not download PDF.

Just corrected. I havenā€™t to put the absolute URL, only ā€œ/suitedirectory/IMG.jpgā€ and insert it from Add image icon.

Do I need to save image at particular folder in the CRM?

Youā€™ve tried the standard logo and standard template and it doesnā€™t work?
It sounds like permission issues in that case.

Check out this issue here:

if you add the debug parameter to the pdf library, probably your logs will tell you more about the situation as well?

I tried on the custom pdf template.

Where can I find this directory mentioned in the PR.

And the Fix was:
sudo chown -R daemon:daemon /opt/bitnami/php/tmp/

This one worked! Upload image to root directory and use image name.