cerovic Posted September 5, 2011 Share Posted September 5, 2011 I red a lot about customization of PDF invoice, since the basic properties are not safisty. I just need to put the seller information to the header. I consider the simplest solution is to substitute the company logo by logo with company information. However the process is not so easy, since you have set the maximum height of invoice logo to 72 px (I suppose), so the invoice logo with seller information looks like the attachment. So I tried to change the 72 px limit in fpdf.php Original piece of code: if($unit=='pt') $this->k=1; elseif($unit=='mm') $this->k=72/25.4; elseif($unit=='cm') $this->k=72/2.54; elseif($unit=='in') $this->k=72; Substitute: if($unit=='pt') $this->k=1; elseif($unit=='mm') $this->k=235/82.9; elseif($unit=='cm') $this->k=235/8.29; elseif($unit=='in') $this->k=235; However, the result is still the same, like in the attached image. Is this right way? If so, why is it still the same size? Does anybody have any point? Link to comment Share on other sites More sharing options...
justinl Posted January 5, 2012 Share Posted January 5, 2012 I know this is old, but I've found myself adjusting the size of the logo myself and I think you're adjusting it in the wrong place. Prestashop doesn't limit the height to 72pixels, what you see happening is the PDF generator is changing the logo to 72 DPI. If you want to adjust the size of the logo, override the header() function in the PDF.php class. around the middle of the function you'll find some code like this: if (file_exists(_PS_IMG_DIR_.'/logo_invoice.jpg')) $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15); the last two params in the function allow you to scale the logo. If you want it bigger, change that 15 to a larger number such as 30. I'm not sure exactly what unit is being used but that's the easy solution to the answer for adjusting the size of the logo in your PDF. Justin Link to comment Share on other sites More sharing options...
miyco Posted April 20, 2012 Share Posted April 20, 2012 Justinl i tried your solution but it doesnt work.. hope for more proposals Link to comment Share on other sites More sharing options...
BoKr Posted March 27, 2013 Share Posted March 27, 2013 I know this is old, but I've found myself adjusting the size of the logo myself and I think you're adjusting it in the wrong place. Prestashop doesn't limit the height to 72pixels, what you see happening is the PDF generator is changing the logo to 72 DPI. If you want to adjust the size of the logo, override the header() function in the PDF.php class. around the middle of the function you'll find some code like this: if (file_exists(_PS_IMG_DIR_.'/logo_invoice.jpg')) $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15); the last two params in the function allow you to scale the logo. If you want it bigger, change that 15 to a larger number such as 30. I'm not sure exactly what unit is being used but that's the easy solution to the answer for adjusting the size of the logo in your PDF. Justin Ok I looked also at if (file_exists(_PS_IMG_DIR_.'/logo_invoice.jpg')) { if ($this->_isPngFile(_PS_IMG_DIR_.'/logo_invoice.jpg')) $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15, 'PNG'); else $this->Image(_PS_IMG_DIR_.'/logo_invoice.jpg', 10, 8, 0, 15); } elseif (file_exists(_PS_IMG_DIR_.'/logo.jpg')) { if ($this->_isPngFile(_PS_IMG_DIR_.'/logo.jpg')) $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15, 'PNG'); else $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15); } and could not size up my logo. I already moved a newer and bigger logo into /prestashop/img/logo_invoice.jpg with eg. 130pxx130px. No changes appear Would be really great if I could make our logo bigger and perhaps if I could even add a header line with our company's name. Can some one help me here`? Link to comment Share on other sites More sharing options...
Whispar1 Posted March 27, 2013 Share Posted March 27, 2013 Have you tried editing header.tpl in your pdf folder? Starting around line 27 you will see this: <td style="width: 50%"> {if $logo_path} <img src="{$logo_path}" style="width:{$width_logo}px; height:{$height_logo}px;" /> {/if} </td> Maybe try changing image src path to the image you made /prestashop/img/logo_invoice.jpg ? Link to comment Share on other sites More sharing options...
Guest Posted March 11, 2015 Share Posted March 11, 2015 There is a much simpler solution. I simply doubled the size of my logos footprint but retained the logo images size. I effectively added a bottom and right side border equal to the original logos size. Save the logo as a GIF with the background (added size) as transparent. Worked first time. Link to comment Share on other sites More sharing options...
tuk66 Posted March 12, 2015 Share Posted March 12, 2015 I red a lot about customization of PDF invoice, since the basic properties are not safisty. I just need to put the seller information to the header. I consider the simplest solution is to substitute the company logo by logo with company information. However the process is not so easy, since you have set the maximum height of invoice logo to 72 px (I suppose), so the invoice logo with seller information looks like the attachment. So I tried to change the 72 px limit in fpdf.php Original piece of code: if($unit=='pt') $this->k=1; elseif($unit=='mm') $this->k=72/25.4; elseif($unit=='cm') $this->k=72/2.54; elseif($unit=='in') $this->k=72; Substitute: if($unit=='pt') $this->k=1; elseif($unit=='mm') $this->k=235/82.9; elseif($unit=='cm') $this->k=235/8.29; elseif($unit=='in') $this->k=235; However, the result is still the same, like in the attached image. Is this right way? If so, why is it still the same size? Does anybody have any point? What is your PrestaShop version? It looks like v1.4. Invoices are completely different from v1.5. Link to comment Share on other sites More sharing options...
Recommended Posts