Returns the abscissa of the current position.
float GetX()
Returns the ordinate of the current position.
float GetY()
Defines the abscissa of the current position. If the passed value is negative, it is relative to the right of the page.
float SetX(float x)
Sets the ordinate and optionally moves the current abscissa back to the left margin. If the value is negative, it is relative to the bottom of the page.
float SetY(float y)
Sets the ordinate and optionally moves the current abscissa back to the left margin. If the value is negative, it is relative to the bottom of the page.
SetXY(float x, float y)
Returns the current page height.
float GetPageHeight()
Returns the current page width.
float GetPageWidth()
Returns the length of a string in user unit. A font must be selected.
float GetStringWidth(string)
<?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); $pdf -> Cell(190,10,'Positions','B',1,'C'); $pdf -> Cell(190,5,'',0,1,'C',false); $x = $pdf -> GetX(); $pdf -> Cell(100,10,"Current Position ( X ) : ".$x." cm",0,1); $y = $pdf -> GetY(); $pdf -> Cell(50,10,"Current Position ( Y ) : ".$y." cm",0,1); $pdf -> SetX(10); $pdf -> SetY(145); $pdf -> Cell(0,5,"X Position : ".$pdf -> GetX()." cm - Y Position : ".$pdf -> GetY()." cm",0); $pdf -> SetXY(30,170); $pdf -> Cell(0,5,"X Position : ".$pdf -> GetX()." cm - Y Position : ".$pdf -> GetY()." cm",0); $pdf -> Cell(190,15,'',0,1,'C',false); $h = $pdf -> GetPageHeight(); $pdf -> Cell(100,10,"Height of the Page : ".$h." mm",0,1); $w = $pdf -> GetPageWidth(); $pdf -> Cell(50,10,"Width of the Page : ".$w." mm",0,1); $pdf -> Cell(190,15,'',0,1,'C',false); $len = $pdf -> GetStringWidth('Tutor Joes'); $pdf -> Cell(21,10,"Tutor Joes",0,1); $pdf -> Cell(100,10,"String Length : ".$len." mm",0,1); $pdf -> Output(); // Display output ?>View Demo
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions