Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text. If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
This method allows printing text with line breaks. They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, This constructor using same parameters as Cell
This method prints text from the current position. When the right margin is reached (or the \n character is met) a line break occurs and text continues from the left margin. Upon method exit, the current position is left just at the end of the text.It is possible to put a link on the text.
Prints a character string. The origin is on the left of the first character, on the baseline. This method allows to place a string precisely on the page, but it is usually easier to use Cell(), MultiCell() or Write() which are the standard methods to print text.
<?php require_once "fpdf/fpdf.php"; //fpdf supporting file $pdf = new FPDF('P','mm','A4'); $pdf -> AddPage(); //addFont(family,style,file) $pdf -> addFont('Roboto','','Roboto.php'); //Adding Custom Font $pdf -> SetFont('Roboto','',10); /*-------------------------with line Break-----------------------------------*/ // Cell(width,height,text,border,line Break, [align],[colorFill]) $pdf -> Cell(30,5,'Tutor Joes',1,1,'C',false); /*-------------------------without line Break--------------------------------*/ $pdf -> Cell(30,5,'Tutor',1,0,'C',false); $pdf -> Cell(30,5,'Joes',1,1,'C',false); /*-----------------------------without Border--------------------------------*/ $pdf -> Cell(200,5,'Tutor Joes Computer Education',0,1,'C',false); $pdf -> Cell(200,5,'',0,1,'C',false); /*--------------Creating Multiple lines in single Cell---------------------*/ // MultiCell(width,height,text,border, [align],[colorFill]) $pdf -> MultiCell(150,5,'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos fugiat minima vero perspiciatis temporibus quia libero impedit accusamus corporis ducimus mollitia, sint sit neque ab officiis facere quidem eaque quasi.',1,'C'); /*--------------Text printing using write---------------------*/ //Write(height,text) $pdf -> Cell(200,5,'',0,1,'C',false); $pdf -> Write(5,'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos fugiat minima vero perspiciatis temporibus quia libero impedit accusamus corporis ducimus mollitia, sint sit neque ab officiis facere quidem eaque quasi.'); $pdf -> Cell(200,10,'',0,1,'C',false); $pdf -> Write(5,'Text with Link - Click Here','https://tutorjoes.in/'); /*--------------Text printing using text---------------------*/ //Write(height,text) $pdf -> Cell(200,5,'',0,1,'C',false); $pdf -> Text(11,80,'Using Text'); $pdf -> Output(); // Display output ?>View Demo
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions