Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resize Logo Image on Customer Invoice/Credit Note
03-05-2020, 03:39 AM,
#1
Resize Logo Image on Customer Invoice/Credit Note
The logo on the customer invoice/credit note is totally over sized and stretched. How would I resize the image. Thanks in advance.
Reply
03-05-2020, 04:09 AM, (This post was last modified: 03-05-2020, 04:13 AM by dalescott.)
#2
RE: Resize Logo Image on Customer Invoice/Credit Note
I suspect your logo size and shape is not what the invoice/credit note designer had in mind when they created the note. It may be simplest to crop and re-size your logo (my goto for this would be Irfanview). Sorry I can't say what size/shape is compatible, but assuming the logo in the demo looks acceptable I would start by simply making mine the same.

To look _really_ good, it is possible the design of the invoice/credit note will have to be changed to accommodate your particular logo size and shape, in which case you will have to decide how much effort is justified for the gain in cosmetic appearance.

Good luck,
Dale

http://www.dalescott.net
Reply
03-05-2020, 04:20 AM,
#3
RE: Resize Logo Image on Customer Invoice/Credit Note
Dale,

Thank you for the quick response. I will have a go at it.

Regards,
Reply
03-05-2020, 05:44 AM,
#4
RE: Resize Logo Image on Customer Invoice/Credit Note
The files you ned to look at if you want to play around with the image file that you have are includes/PDFTransPageHeader.inc and includes/PDFTransPageHeaderPortrait.inc

Look for the lines like:

$pdf->addJpegFromFile($_SESSION['LogoFile'],$Page_Width/2 -120,$YPos-40,0,60);

where the parameters are horizontal position, the vertical position the width, and the height. You may need to play with some other lines as well if your logo pushes something out.

Hope this helps,
Tim

Reply
03-05-2020, 05:10 PM, (This post was last modified: 03-05-2020, 05:37 PM by Confucius.)
#5
RE: Resize Logo Image on Customer Invoice/Credit Note
Tim, thanks. I did change the values in the PrintCustTrans.php but that was in hindsight the wrong spot.

Regards,
Hi Guys, is there anyone who has implemented alternate row backgrounds in the PDF reports, like the Price List etc? Any examples or pointers would be of value.
Thanks in advance.
Reply
03-06-2020, 03:10 PM, (This post was last modified: 04-25-2020, 12:52 PM by TurboPT.)
#6
RE: Resize Logo Image on Customer Invoice/Credit Note
Confucius Wrote:Hi Guys, is there anyone who has implemented alternate row backgrounds in the PDF reports, like the Price List etc? Any examples or pointers would be of value.
Thanks in advance.

I can help with the row shading, but it will not be until Saturday before I can give details and/or an example. (I've attached a 2-line example that I threw together for a quick check, below, but it's incomplete) It's already near midnight in my locale, and I don't know that I'll get to it tomorrow.

The shading is not easily done, but it is doable. The 'rows' are not really rows like a HTML table row concept, rather, the PDF 'rows' are line offsets, and the data within each line is (sort of) like cells, so it's a cell-by-cell shading on alternating lines to achieve the shading effect.

Where you say "like the Price List", is that the desired PDF to have shading, or does that imply that it already has shading?
(I don't currently have any pricing set, but I could surely add a few lines)

PDF row shading example
Reply
03-06-2020, 04:59 PM,
#7
RE: Resize Logo Image on Customer Invoice/Credit Note
TurboPT, I would appreciate the help. It can wait until you're able to assist. There is not shading done.

Thanks again.

Regards,
Reply
03-06-2020, 07:20 PM,
#8
RE: Resize Logo Image on Customer Invoice/Credit Note
This was done in the MRP reports. See MRPPlannedPurchaseOrders.php lines 154 to 185 for an example.

Tim
Reply
03-06-2020, 10:59 PM, (This post was last modified: 03-07-2020, 11:30 AM by TurboPT.)
#9
RE: Resize Logo Image on Customer Invoice/Credit Note
Tim:
Thanks for that find.
That is very close to my example. The SetFillColor() is better than what I found, less arguments, which is basically the only difference.

Confucius:
In the file area that Tim mentioned, see use of the function mentioned above, along with the $fill variable use. The function simply uses 3 rgb values to set the desired color.
I used 238, 238, 238 for the grey coloring in my previous image example.
Reply
03-08-2020, 10:50 AM, (This post was last modified: 03-08-2020, 12:15 PM by TurboPT.)
#10
RE: Resize Logo Image on Customer Invoice/Credit Note
Confucius:
Apologies for the delay, had to fight with the Price List file a little more than expected. Not as much use of addTextWrap() to ease the task unlike other files.
(like I said earlier, not easily done, but doable)

Anyway, save a copy of your current file and try the attached file. (this file is based on version 4.15.1)
Example screenshot attached too.


Attached Files Thumbnail(s)
   

.php   PDFPriceList.php (Size: 21.96 KB / Downloads: 18)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)