TCPDF how to set two text color?

devjunx

New Member
Currently I am trying to customize the whmcs invoice pdf. They have this following code\[code\] # 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',12);$pdf->Cell(110,20,strtoupper($statustext),0,0,'C');$pdf->setPage($endpage);?>\[/code\]This code produce this format,For example, if paymenet is "Unpaid", code produce this echo statement\[quote\] UNPAID (with red color)\[/quote\]so what I am trying to do is, I would like to add this text "Status:" infront of "UNPAID" so for example, when echo out, it will become like this\[quote\] "Status: UNPAID"\[/quote\]I can get it by adding this code\[code\]} elseif ($status=="Unpaid") { $statustext = $_LANG["statustext"]; $statustext = $_LANG["invoicesunpaid"]; $pdf->SetTextColor(245,245,245);\[/code\]But because of this code\[code\]$pdf->SetTextColor(245,245,245);\[/code\]Status: becomes (Red) as well.What can I achieve to get Status: text black and UNPAID remained as "RED". Please kindly point me out. Thank you.
 
Back
Top