FPDF text align – FPDF align text LEFT, Center and Right example

In this post we will show you FPDF text align – FPDF align text LEFT, Center and Right, hear for FPDF text align – FPDF align text LEFT, Center and Right we will give you demo and example for implement.

FPDF text align :: Allows to center or align the text.

FPDF align text – FPDF align text LEFT, Center and Right foir Possible values are::

L or empty string :: left align (default value)
C :: center align
R :: right align

code for FPDF align text – FPDF align text LEFT, Center and Right example

// include fpdf file
include('fpdf.php');

$fpdf_align = new FPDF("P");

$fpdf_align->setMargins(22, 45, 11.6);
$fpdf_align->AddPage();

$fpdf_align->SetXY(0, 11);
$fpdf_align->SetX(12.6);
// FPDF align LEFT text 
$fpdf_align->Cell(0,11,'::Left text::',0,0,'L');
$fpdf_align->SetX(12.6);
// FPDF align Center text 
$fpdf_align->Cell(0,11,'::Center text::',0,0,'C');
$fpdf_align->SetX(12.6);
// FPDF align Right text 
$fpdf_align->Cell( 0, 11, '::Right text::', 0, 0, 'R' ); 
$fpdf_align->Output();

output of FPDF align text and FPDF align text LEFT, Center and Right example

FPDF text align - FPDF align text LEFT, Center and Right example
FPDF text align – FPDF align text LEFT, Center and Right example

Hope this code and post will helped you for implement FPDF text align – FPDF align text LEFT, Center and Right. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs onlincode.org