JulesR Posted July 28, 2009 Share Posted July 28, 2009 I spent some time today trying to figure out how to replace the logo in the PDF invoices, and based on some of the posts in these forums and a little digging around, I managed to figure it out. Hopefully this will help anyone else looking for information: The file you need to edit is: templates/<templatename>/invoicepdf.tpl Replace "<templatename>" with the name of the template you're currently using. Look for this section at the top: # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25); We can add some additional values to this line to specify the image width and height, but these values need to be specified in mm and not pixels as you may assume. If you need to determine the size in mm based on the current pixel dimensions of your image, you can use a calculator here: http://www.unitconversion.org/typography/pixels-x-to-millimeters-conversion.html Once you've obtained your dimensions, replace the PHP line above to something like this: # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25,widthinmm, heightinmm); Replace widthinmm and heightinmm to their respective numeric values. Save the file, and hey presto, you should be good to go 0 Quote Link to comment Share on other sites More sharing options...
fearmydesign Posted July 30, 2009 Share Posted July 30, 2009 This is really helpful, thank you for posting these instructions. 0 Quote Link to comment Share on other sites More sharing options...
haner Posted July 30, 2009 Share Posted July 30, 2009 Weird.. I tried this and the image size is still bloated. The logo also moved to the middle of the pdf instead of left justified. 0 Quote Link to comment Share on other sites More sharing options...
hostwire Posted July 31, 2009 Share Posted July 31, 2009 Weird.. I tried this and the image size is still bloated. The logo also moved to the middle of the pdf instead of left justified. Just change the coordinates/margins From this # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25); to this # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,5); 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted July 31, 2009 Share Posted July 31, 2009 Just change the coordinates/margins From this # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25); to this # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,5); I've been trying the same thing myself. I decided to try removing the 20,5 entirely to see if I could get it to stop screwing with the image. Unfortunately, it's still overblown. I'm frustrated with trying to resize it, and I don't think I can resize the image down any further before it becomes unreadable. 0 Quote Link to comment Share on other sites More sharing options...
hostwire Posted July 31, 2009 Share Posted July 31, 2009 How are you testing to see if it is working or not. I modified it and it worked without issue for me. Might want to try this as well at the top of file. $pdf->Image('http://yourdomain/whmcs/templates/templatename/images/business_logo.gif',20,5); 0 Quote Link to comment Share on other sites More sharing options...
KingJ Posted August 1, 2009 Share Posted August 1, 2009 This was a great help, thanks for posting. 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 2, 2009 Author Share Posted August 2, 2009 If it's still bloated, make sure you converted pixels to MM correctly using the link above. Pixels will not work and will leave the image looking very bloated since they are much larger in scale than MM. You shouldn't need to modify the margin at all, regardless of image size. 0 Quote Link to comment Share on other sites More sharing options...
Alliance Posted August 6, 2009 Share Posted August 6, 2009 thanks a lot 0 Quote Link to comment Share on other sites More sharing options...
JLHC Posted August 6, 2009 Share Posted August 6, 2009 Any idea whether it works with version 3.8.2 as well? 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 6, 2009 Author Share Posted August 6, 2009 Assuming the PDF invoice generation process hasn't changed much (and I don't believe it has at all), it should work fine. Are you having problems getting it working? 0 Quote Link to comment Share on other sites More sharing options...
pblakstad Posted August 7, 2009 Share Posted August 7, 2009 This does not work for me either. Nothing happens with the size of the logo. I've converted pix to mm. Anyone? 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 7, 2009 Author Share Posted August 7, 2009 It works fine in the latest version of WHMCS. If you're running an earlier version, I suggest upgrading. 0 Quote Link to comment Share on other sites More sharing options...
pblakstad Posted August 7, 2009 Share Posted August 7, 2009 I have the latest version but it still does not work. 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 7, 2009 Author Share Posted August 7, 2009 If you followed the instructions it should work perfectly fine. Are you sure you edited the file in the correct template? 0 Quote Link to comment Share on other sites More sharing options...
pblakstad Posted August 7, 2009 Share Posted August 7, 2009 Actually, that might be the issue. I'll test. Thanks for the tips. 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 7, 2009 Author Share Posted August 7, 2009 If in doubt, edit them all, it can't hurt 0 Quote Link to comment Share on other sites More sharing options...
pblakstad Posted August 7, 2009 Share Posted August 7, 2009 Ok, now i feel really stupid. I edited the wrong template. It works fine now Sorry for wasting your time and thanks alot for your help 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 7, 2009 Author Share Posted August 7, 2009 No problem, glad it's working for you 0 Quote Link to comment Share on other sites More sharing options...
pblakstad Posted August 7, 2009 Share Posted August 7, 2009 Perhaps you have a solution to this problem also: http://forum.whmcs.com/showthread.php?t=22635 ? 0 Quote Link to comment Share on other sites More sharing options...
JulesR Posted August 7, 2009 Author Share Posted August 7, 2009 I responded to your post, but don't hijack this thread please. This is for the discussion of the PDF logo changes only. 0 Quote Link to comment Share on other sites More sharing options...
cyberneticos Posted September 28, 2009 Share Posted September 28, 2009 excellent,. I was trying to convert using Photoshop, and did not work, your link worked perfectly. Thanks ! 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted October 2, 2009 Share Posted October 2, 2009 I have to thank you for that. Worked like a charm! 0 Quote Link to comment Share on other sites More sharing options...
Damainman Posted October 8, 2009 Share Posted October 8, 2009 (edited) I'm having the same issue as well. Here is what my line looks like: (I'm running the latest WHMCS, uncustomized) $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25,35,26); The file i'm editing is: - /templates/default/quotepdf.tpl Update: Nevermind, I needed to update the portal template instead!! lol. Your awesome!! Thanks for this amazing tip. Edited October 8, 2009 by Damainman 0 Quote Link to comment Share on other sites More sharing options...
alinagosh Posted October 16, 2009 Share Posted October 16, 2009 Yup latest version didn't work for the latest sites & sizes .I also tried on my own site & on blog also.I wanna get more information about latest version why its not successful as previous was. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.