Jump to content

PDF Invoice - Capitalisation of Accent Characters


WHMCS John

Recommended Posts

  • WHMCS Support Manager

Due to a limitation in PHP you may find the translations of the "Paid" and "Unpaid" text on the PDF Invoices do not display upper-case accented characters correctly. The problem here is that the native PHP uppercase conversion functions cannot convert special characters into their upper-case equivalents.

 

There are 2 solutions :

 

1. Edit the language file to contain the uppercase version of the status text by default for invoices. ie. Change "Non payée" to "NON PAYÉE"

 

2. Make the following template change in the invoicepdf.tpl file:

 

FIND:

 

$pdf->Cell(100,18,strtoupper($statustext),'TB',0,'C','1');

 

REPLACE WITH:

 

$pdf->Cell(100,18,mb_strtoupper($statustext,'utf-8'),'TB',0,'C','1');

 

For this second solution to work the MB String functions library needs to be compiled into the PHP build on your server (http://uk.php.net/mbstring).

 

 

 

Pdfaccent2.png --> Pdfaccent1.png

Link to comment
Share on other sites

  • 1 month later...

is there a way to remove the box around the text?

 

# Payment Status

$endpage = $pdf->GetPage();

$pdf->setPage($startpage);

$pdf->SetXY(85,$addressypos);

if ($status=="Cancelled") {

$statustext = $_LANG["invoicescancelled"];

$pdf->SetTextColor(245,245,245);

} elseif ($status=="Unpaid") {

$statustext = $_LANG["invoicesunpaid"];

$pdf->SetTextColor(204,0,0);

} elseif ($status=="Paid") {

$statustext = $_LANG["invoicespaid"];

$pdf->SetTextColor(153,204,0);

} elseif ($status=="Refunded") {

$statustext = $_LANG["invoicesrefunded"];

$pdf->SetTextColor(34,68,136);

} elseif ($status=="Collections") {

$statustext = $_LANG["invoicescollections"];

$pdf->SetTextColor(255,204,0);

}

$pdf->SetFont('freesans','B',20);

$pdf->Cell(100,18,mb_strtoupper($statustext,'utf-8'),'TB',0,'C','1');

$pdf->setPage($endpage);

 

 

I just cant find the way to remove the box and just leave the text displayed

Link to comment
Share on other sites

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