Media Corp. Posted October 19, 2007 Share Posted October 19, 2007 Hi there, I am configuring our PDF setup for invoices. All I've done is upload our logo to the /clients/images/ folder with the filename 'logo.jpg' When I create a test invoice, I get a weird format. The logo seems to be stretched to 2-3 times the size it should be. I'm not sure how to include the screenshot (sorry). I then went and made a simple circle in blue at a width and height of 78px (the same height as the default WHMCS logo) and uploaded it. It too blows up and goes in behind that grey bar of the invoice. Have any of you experienced this? I've tried everything and it keeps coming up with this huge, pixelated image. Thanks, Derek I have not made any changes to pdfconfig.php. 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 19, 2007 Share Posted October 19, 2007 IIRC you'll need to keep the height and width the same as the WHMCS logo. I may be wrong though.. 0 Quote Link to comment Share on other sites More sharing options...
Media Corp. Posted October 19, 2007 Author Share Posted October 19, 2007 I've tried by keeping the HEIGHT of the original logo (78px). I simply used a circle with that diameter. I will now try retaining the WIDTH as well. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Media Corp. Posted October 19, 2007 Author Share Posted October 19, 2007 If I upload a logo that is a BLUE square with the same dimensions as the included WHMCS logo, it looks as it should. If I upload a logo that is a WHITE square with the same dimensions AND a BLUE circle in the middle, it ends up getting STETCHED so that the BLUE circle matches the dimensions of the stock logo. If I upload that same logo with a pink background (instead of white) it works fine. It seems to be ignoring the white background of the logo and scaling up the blue circle. Weird! So, it seems as though I must use a logo that is the same size as the stock logo, and NOT have whitespace around it. The logo must be coloured. Any thoughts? Thanks, Derek 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted October 19, 2007 Share Posted October 19, 2007 I'd put that down to the application that you are using to save the image. I have a little whitespace around my logo and it doesn't ignore that. Make sure your image application isn't auto cropping your files. 0 Quote Link to comment Share on other sites More sharing options...
Media Corp. Posted October 19, 2007 Author Share Posted October 19, 2007 I'm using CS3 on a MacBook Pro. It's not auto-cropping. Even with the pink background and the blue circle...the blue circle is really pixelated and looks horrible. I'm going to have to forget about the logo idea. I've created and uploaded a white image that fits the same dimensions as the stock logo (175 x 78px). Now PDF invoices appear to have no logo at all (which will have to do). I wish this worked though. Seems like a very simple concept, but it's broken. 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted October 19, 2007 Share Posted October 19, 2007 or you can edit the pdfconfig.php within the includes directory. search for this string: $pdf->Image(dirname(__FILE__).'/../images/logo.jpg',10,5,52,14); it should be the first one, play with the numbers a bit, make a backup first. and here are some instructions about how to edit it: ======== Image(string file, float x, float y [, float w [, float h [, string type [, mixed link]]]]) Parameters file Name of the file containing the image. x Abscissa of the upper-left corner. y Ordinate of the upper-left corner. w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. type Image format. Possible values are (case insensitive): JPG, JPEG, PNG. If not specified, the type is inferred from the file extension. link URL or identifier returned by AddLink(). ========== or you can check this link: http://www.id.unizh.ch/cl/zinfo/fpdf/doc/image.htm 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted October 19, 2007 WHMCS CEO Share Posted October 19, 2007 I wish this worked though. Seems like a very simple concept, but it's broken. The only thing that's broken is the image you are using! Keep your logo the same size as the original and there won't be a problem or if you have a different sized logo, you need to alter the size parameters as has been posted above. Matt 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted October 19, 2007 Share Posted October 19, 2007 i don;t remember very well but the x,y,w,h are not calculated in pixels but in milimeters. i am not sure about this thou. 0 Quote Link to comment Share on other sites More sharing options...
BionHostStan Posted November 24, 2007 Share Posted November 24, 2007 $pdf->Image(dirname(__FILE__).'/../images/logo.jpg',15,10,50); is what my thing says by default. I assume the 15 and 10 are the float points along x and y and the 50 pertains to the width? So I just remove the 50 and it should be calculated automatically? How does this work exactly... and how do I generate a test pdf to make sure everything went right without a client receiving an email or anything. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted November 24, 2007 Share Posted November 24, 2007 how do I generate a test pdf to make sure everything went right without a client receiving an email or anything. I keep a dummy account in my install with my email to test things. Comes in handy. 0 Quote Link to comment Share on other sites More sharing options...
BionHostStan Posted November 26, 2007 Share Posted November 26, 2007 lot of extra work... why not have a preview function 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted November 26, 2007 WHMCS CEO Share Posted November 26, 2007 Just open up any invoice and click Download PDF to preview it?!?!? Matt 0 Quote Link to comment Share on other sites More sharing options...
Gears Posted January 17, 2008 Share Posted January 17, 2008 http://www.unitconversion.org/typography/pixels-x-to-millimeters-conversion.html 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.