PDF invoice customization - problems with logo

Discussion in 'Templates customization' started by tomfra, Apr 2, 2008.

  1. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    Does anyone actually know how big the /amember/logo.jpg picture should be? No matter how I try, it always looks ugly and is placed badly too. I'd really like to see where the get_pdf_invoice function is defined so that I could modify a few things but can't find it.

    There are more things I'd like to edit in the invoice and not everything is possible with the template only.

    Any idea is appreciated!

    Tomas
  2. susan_el

    susan_el Guest

    I create a 500 pixel width logo and it works fine - a little blurry but acceptable.
  3. getresults

    getresults Member

    Joined:
    Nov 1, 2006
    Messages:
    87
    Look in common.inc.php for parse_pdf_content() for the page setup function.

    That calls $pdf->Image() to insert the image.

    You'll find pdf->Image() in includes/fpdf.php

    Line 746 of common.inc.php is probably of the most interest to you as it determines the placement of the image and the image dimensions.

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

    $x and $y are the upper left co-ordinates of the image, $size[0] and $size[1] are the width and height.
  4. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    Actually, since I started this thread, I have completely replaced the original PDF invoice function with a much better system that converts standard html invoice template into pdf and allows the customer to view the html version as well.

    It's not so simple to share the code with everyone though. While it is much better, I have not created a generic invoice template that could be used by anyone and some code cleaning may be necessary. But if someone really hates the original pdf invoice feature, let me know and I will share what I have so far.

    Tomas
  5. getresults

    getresults Member

    Joined:
    Nov 1, 2006
    Messages:
    87
    I'd be interested to see what you've done :)
  6. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    OK, if you want, you can download my first publicly available version of "Better aMember Invoicing" at:

    http://webnexusone.com/dev/better_amember_invoicing_v1.zip

    It does use the dompdf library for the html-to-pdf conversion (not created by me), it is included in the zip file so you do not have to download it separately.

    README.TXT with installation instructions is included in the zip file.

    Tomas
  7. dglore

    dglore New Member

    Joined:
    Mar 9, 2010
    Messages:
    1
    Hi tomfra - I used the download you provided and it works great for the HTML but on the PDF I'm getting this error code:

    Parse error: syntax error, unexpected T_NEW in /home/tradeabo/public_html/dompdf/include/functions.inc.php on line 240

    Any idea how to fix this?

    Thanks,
    Dennis

Share This Page