Jump to content

PDF Invoice - Logo Issue


Media Corp.

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

 

:x

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • WHMCS CEO
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

Link to comment
Share on other sites

  • 1 month later...

$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.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated