Jump to content

Force Invoices to print first letter of each word in upper case.


Recommended Posts

Hi to stop having to tidy up PDF invoices and capitalise names, addresses and postcodes, you can force the address and name to be in first letter upper-case and the postcode all upper-case.

Go to document:
Classes/ PDF.php

Insert the red text to capitalise first letter of each word.
$pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), ucwords($invoice_address->address2)), 0, 'L');

To make the postcode all capitals add the green code above.
$pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), strtoupper($invoice_address->postcode)), 0, 'L');
$pdf->Ln(5);


You can add to each line of the address, the customers name and so on.

Hope its useful.

Link to comment
Share on other sites

  • 3 years later...
  • 2 years later...

There are two ways that I would test out. I would test out the smarty modifier that the previous poster stated or I would test out using css. I am pretty sure that inline style work with the pdf library used, but I am not positive if that style is supported. 

Link to comment
Share on other sites

×
×
  • Create New...