I'm integrating tcpdf for pdf generation. I having problem in background-color not appearing in pdf. I'm using rgba color code for background-color table rows.
html code:
<table>
<tr>
<td>ID</td>
<td>Name</td>
<td>Mark</td>
</tr>
<tr>
<td>1</td>
<td>test</td>
<td style="background-color:rgba(0, 255, 0, 1) none repeat scroll 0 0">100<td/>
</tr>
<tr>
<td>2</td>
<td>test2</td>
<td style="background-color:rgba(0, 255, 0, 0.85) none repeat scroll 0 0">66<td/>
</tr>
<tr>
<td>3</td>
<td>test3</td>
<td style="background-color:rgba(0, 255, 0, 0.22) none repeat scroll 0 0">45<td/>
</tr>
<tr>
<td>4</td>
<td>test4</td>
<td style="background-color:rgba(0, 255, 0, 0.08) none repeat scroll 0 0">12<td/>
</tr>
</table>
PHP Code
$pdf->writeHTMLCell(200, '', '50', '40', $html, 0, 1, 1, true, 'C', true);
if tcpdf not support rgba code. How to convert rgba into html color code for that corresponding values.Kindly guide me. I'm looking forward for your reply.
TCPDF
will not support normal html
style
property. you have to add below line to set the bg color.
$pdf->SetFillColor(0,255,0);
for setting opacity try
$pdf->SetAlpha(0.5);
$pdf
is TCPDF
class object reference TCPDF documentation