bigmike7801 Posted March 31, 2009 Share Posted March 31, 2009 (edited) SO each time a generate an invoice, the logo that I've created specifically for the pdf appears blurry. Has anyone else experienced this? I've read the manual for the Imgae function for FPDF (http://www.fpdf.org/en/doc/image.htm) This is what my current logo code looks like in pdfconfig.php # Logo $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25); You can see a screen shot I took of the blurry invoice logo here (http://www.marswebcreations.com/test/blurry-logo.jpg) and the original image here: (http://www.marswebcreations.com/client/images/logo.jpg) The dimensions of my image is 200px wide by 68px tall and it's obviously being enlarged for some reason. Does anybody see a problem with this? Edited March 31, 2009 by bigmike7801 Add images 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted March 31, 2009 Share Posted March 31, 2009 Does anybody see a problem with this? Well, yes, I agree with you that it is not satisfactory and you are right to wish your company's image to be better presented. I cannot offer any fix for this but suggest that you open a ticket with WHMCS Support to address the issue. It's certainly an important consideration. Best wishes with this. 0 Quote Link to comment Share on other sites More sharing options...
bigmike7801 Posted March 31, 2009 Author Share Posted March 31, 2009 I actually came accross this thread at FPDF's own forum and am not the only one having this problem. http://www.fpdf.org/phorum/read.php?f=1&i=45325&t=45325 0 Quote Link to comment Share on other sites More sharing options...
bluetreehost Posted April 2, 2009 Share Posted April 2, 2009 I had luck by creating an image and then adding a parameter (width) to the function: $pdf->Image(ROOTDIR.'/images/logo.jpg',20,15,50); My image is actually 291x170 and this results in a nice sized logo with no blurriness. 0 Quote Link to comment Share on other sites More sharing options...
MonkeyMagic Posted April 3, 2009 Share Posted April 3, 2009 so how does 20,15,50 correspond to 291x170? Would be nice to use this too to fix our blurry logo 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 3, 2009 Share Posted April 3, 2009 Try this... it will resize the image at 150 dots/inch $pdf->Image(ROOTDIR.'/images/logo.jpg',100,20,75,0,'',$CONFIG['Domain'],'',true,150);For details on what the settings are for look at the specs for the image function below method Image [line 4211] image Image( string $file, [float $x = ''], [float $y = ''], [float $w = 0], [float $h = 0], [string $type = ''], [mixed $link = ''], [string $align = ''], [boolean $resize = false], [int $dpi = 300], [string $palign = ''], [boolean $ismask = false], [mixed $imgmask = false], [mixed $border = 0]) Puts an image in the page. The upper-left corner must be given. The dimensions can be specified in different ways: explicit width and height (expressed in user unit) one explicit dimension, the other being calculated automatically in order to keep the original proportions no explicit dimension, in which case the image is put at 72 dpi Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; The format can be specified explicitly or inferred from the file extension. It is possible to put a link on the image. Remark: if an image is used several times, only one copy will be embedded in the file. Tags: return: information since: 1.1 access: public Parameters: string $file Name of the file containing the image. float $x Abscissa of the upper-left corner. float $y Ordinate of the upper-left corner. float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. mixed $link URL or identifier returned by AddLink(). string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: T: top-right for LTR or top-left for RTL M: middle-right for LTR or middle-left for RTL B: bottom-right for LTR or bottom-left for RTL N: next line boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). int $dpi dot-per-inch resolution used on resize string $palign Allows to center or align the image on the current line. Possible values are: L : left align C : center R : right align '' : empty string : left for LTR or right for RTL boolean $ismask true if this image is a mask, false otherwise mixed $imgmask image object returned by this function or false mixed $border Indicates if borders must be drawn around the image. The value can be either a number: 0: no border (default) 1: frame or a string containing some or all of the following characters (in any order): L: left T: top R: right B: bottom 0 Quote Link to comment Share on other sites More sharing options...
supernix Posted May 9, 2009 Share Posted May 9, 2009 This is a nice start for me to figure out how to fix my logo problem but still not sure as to how to adjust the settings not sure if you have to use every last value and give is a 0 or some other value then insert a comma after each or what. 0 Quote Link to comment Share on other sites More sharing options...
gr2 Posted July 2, 2009 Share Posted July 2, 2009 (edited) an hour or so of trial and error on v4 logo 305x112 @72 dpi $pdf->Image(ROOTDIR.'/images/logo.jpg',20,15,75,25); invoicepdf.tpl hope this helps. Edited July 2, 2009 by gr2 0 Quote Link to comment Share on other sites More sharing options...
Damainman Posted October 8, 2009 Share Posted October 8, 2009 Is there a better way of accomplishing this? I'm completely lost lol, and nothing seems to take away the blurryness from my image. Is there a recommended format or size? 0 Quote Link to comment Share on other sites More sharing options...
mrsandre Posted September 5, 2011 Share Posted September 5, 2011 I had luck by creating an image and then adding a parameter (width) to the function: $pdf->Image(ROOTDIR.'/images/logo.jpg',20,15,50); My image is actually 291x170 and this results in a nice sized logo with no blurriness. This method worked for me after playing with the code a little bit $pdf->Image(ROOTDIR.'/images/logo.jpg',20,15,50); 20 & 15 placed the logo where you want it and 50 sizes it. 0 Quote Link to comment Share on other sites More sharing options...
openmind Posted November 28, 2011 Share Posted November 28, 2011 Just to bump an old thread, just took 1/2 hour to get this right with trial and error on v5 to get rid of the logo blurriness. Really wish this could be updated so that invoice.tpl uses standard html like the other templates and is then read into the system to create the PDF. Seems to be very convoluted at the moment IMHO. 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.