Creating Color Table.
It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
Parametersif without red component, indicates the gray level.
Defines the color used for all drawing operations (lines, rectangles and cell borders).
Defines the color used for all drawing operations (lines, rectangles and cell borders).
Defines the color used for text.
<?php require_once "fpdf/fpdf.php"; //fpdf supporting file $pdf = new FPDF('P','mm','A4'); /* A4 - 210 * 297 mm */ $pdf -> AddPage(); //addFont(family,style,file) $pdf -> addFont('Roboto','','Roboto.php'); $pdf -> SetFont('Roboto','',12); // Creating White Background. (Default background Fill is black) $pdf -> SetFillColor(255, 255, 255); $pdf -> SetDrawColor(0, 0, 255); // Creating Blue Bottom Border $pdf -> Cell(190,10,'Using Fill and Draw Color','B',1,'C',true); $pdf -> Cell(190,20,'',0,1,'C',false); $pdf -> SetFillColor(117, 117, 255); $pdf -> SetTextColor(255, 255, 255); $pdf -> SetDrawColor(117, 117, 255); $pdf -> Cell(190,10,'Using Fill,text and Draw Color',0,1,'C',true); $pdf -> Cell(190,20,'',0,1,'C',false); $pdf -> Cell(190,10,'Student Mark List',0,1,'C',true); $pdf -> SetTextColor(56, 56, 56); // Column Titles $pdf -> Cell(38,7,'SNO',1,0,'C'); $pdf -> Cell(38,7,'NAME',1,0,'C'); $pdf -> Cell(38,7,'MARK 1',1,0,'C'); $pdf -> Cell(38,7,'MARK 2',1,0,'C'); $pdf -> Cell(38,7,'MARK 3',1,1,'C'); // Row Datas $pdf -> Cell(38,7,'1',1,0,'C'); $pdf -> Cell(38,7,'Ram',1,0,''); $pdf -> Cell(38,7,'98',1,0,'C'); $pdf -> Cell(38,7,'97',1,0,'C'); $pdf -> Cell(38,7,'91',1,1,'C'); $pdf -> Cell(38,7,'2',1,0,'C'); $pdf -> Cell(38,7,'Mithran',1,0,''); $pdf -> Cell(38,7,'95',1,0,'C'); $pdf -> Cell(38,7,'87',1,0,'C'); $pdf -> Cell(38,7,'77',1,1,'C'); $pdf -> Cell(38,7,'3',1,0,'C'); $pdf -> Cell(38,7,'Mithwin',1,0,''); $pdf -> Cell(38,7,'97',1,0,'C'); $pdf -> Cell(38,7,'95',1,0,'C'); $pdf -> Cell(38,7,'93',1,1,'C'); $pdf -> Output(); // Display output ?>View Demo
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions