Invoice customization logo.jpg (again)

Discussion in 'Templates customization' started by petrovich, Aug 31, 2010.

  1. petrovich

    petrovich New Member

    Joined:
    Jul 16, 2010
    Messages:
    4
    Hi,

    How can I modify the following code snippet to place my logo.jpg in the top-left corner, between the margins of the A4 paper? Ideally I would like to take up the entire width of the paper.

    Also, does the DPI of the image matter (ie 72 dpi for internet, 300 dpi for print)? Or is there a fixed dimension I should use in mm (we're talking metric here, aren't we?).

    From common.inc.php

    PHP:
        if (is_file($image)){

            
    $size getimagesize($image);

            
    $x $width $size[0] + $margins[0];

            
    $y $current_y;

            
    $pdf->Image ($image$x$y$size[0], $size[1]); // use original size

            
    $current_y += $size[1];

        }
    Thank you in advance :)
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    if you want to place image that will take the entrie width of the page, just create image with that width.
    Page format used is A4(210 x 297)
    margins are 20 mm for each side, so width that can be used for image is 170 mm
    So for 72 DPI image width in pixels should be 477
  3. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    Is it possible to use 300 (or 150) dpi pictures? 72 dpi look like crap when printed :)
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes possible.
  5. erwinvdb

    erwinvdb aMember Pro Customer

    Joined:
    Aug 30, 2007
    Messages:
    264
    I tried using 300dpi images, but then they just blow up. So when printed they are still printed as 72dpi images. How can I fix this?
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Can you contact us in helpdesk and provide example. I will check this.
  7. lushtech

    lushtech New Member

    Joined:
    Jul 16, 2010
    Messages:
    20
    Logo Fuzzy

    I also had a heck of a time positioning the logo and it still does not look clear. I have used all resolutions, but never comes out clean. I would love to know of a good solution/enhancement to remedy this.
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Contact us in helpdesk we will help.
  9. agelinas

    agelinas New Member

    Joined:
    May 11, 2010
    Messages:
    12
    Pdf receipt - logo.jpg

    Has anyone found a simple solution to include a sharp logo.jpg image in the pdf invoice file?

    When I use a high resolution picture, it is sharp but cropped (from the left of picture). Then when I gradually decrease the resolution, which is the only way I found to fit the whole logo and find the right size, the picture becomes more and more fuzzy, which is easy to understand why! I might have to drop the fancy header.

    Thank you,

    Al

Share This Page