Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Close
Login to Your Account
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Location
    Sheffield, UK
    Posts
    8,325

    Default PDF Invoice - Capitalisation of Accent Characters

    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:

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

    Code:
    $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).



    -->
    WHMCompleteSolution
    The Complete Client Management, Billing & Support System
    www.whmcs.com

  2. #2
    Join Date
    Apr 2012
    Posts
    2

    Default

    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

  3. #3
    Join Date
    Feb 2009
    Location
    Atlanta, GA
    Posts
    1,677

  4. #4
    Join Date
    Apr 2012
    Posts
    2

    Default

    thanx works fine although syntax is a bit confusing...

Similar Threads

  1. PDF Issue on Invoices with Greek Characters
    By domains17 in forum Using WHMCS
    Replies: 3
    Last Post: 02-16-14, 10:27 AM
  2. PDF invoice: how can I change the filename invoice-<nr>.pdf?
    By Paderman in forum Developer Corner
    Replies: 1
    Last Post: 11-13-12, 04:42 PM
  3. Replies: 3
    Last Post: 12-22-11, 07:41 PM
  4. upgrade to 3.6.2 pdf invoice characters wrong
    By pera in forum Using WHMCS
    Replies: 4
    Last Post: 08-26-08, 04:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •