0% found this document useful (0 votes)
364 views1 page

Set Text Color in FPDF PHP Script

This document discusses how to add font color when creating a PDF using FPDF in PHP. It shows using the SetTextColor() method to set the font color to white (255,254,254 RGB values) for a cell that contains the text "Hello World!" and a hyperlink. The cell is then added to a new page on a PDF that is outputted and displayed in the browser.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
364 views1 page

Set Text Color in FPDF PHP Script

This document discusses how to add font color when creating a PDF using FPDF in PHP. It shows using the SetTextColor() method to set the font color to white (255,254,254 RGB values) for a cell that contains the text "Hello World!" and a hyperlink. The cell is then added to a new page on a PDF that is outputted and displayed in the browser.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 1

Adding font colour by SetTextColor()

<?Php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->SetFillColor(1,99,255); // input R ,G , B
$pdf->SetTextColor(255,254,254);// input R , G , B
$pdf->Cell(80,10,'Hello World!',1,0,C,true,'https://www.plus2net.com');
$pdf->Output('my_file.pdf','I'); // Send to browser and display
?>

You might also like