AddPage()

	
	AddPage([string orientation [, mixed size [, int rotation]]])

Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer. Then the page is added, the current position set to the top-left corner according to the left and top margins, and Header() is called to display the header. The font which was set before calling is automatically restored. There is no need to call SetFont() again if you want to continue with the same font. The same is true for colors and line width. The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards.

orientation

The default value is the one passed to the constructor.

size

Page size. It can be either one of the following values (case insensitive):

The default value is the one passed to the constructor.

rotation

Angle by which to rotate the page. It must be a multiple of 90; positive values mean clockwise rotation. The default value is 0.

PageNo()

	
	int PageNo()

Returns the current page number.

GetPageHeight()

	
	float GetPageHeight()

Returns the current page height.

GetPageWidth()

	
	float GetPageWidth()

Returns the current page width.

GetX()

	
	float GetX()

Returns the abscissa of the current position.


	$pdf = new FPDF();
	$pdf->SetFont('Arial','B',16);
	
	$pdf->AddPage();
	$x = $pdf->GetX();
	$pdf->Cell(30, 10, $x."  ", 1);
	$x = $pdf->GetX();
	$pdf->Cell(0, 10, $x, 1, 1);

	$pdf->Output('helo.pdf', 'D');

Initially the left margin is 10 unit, that's why the GetX returns 10.00125, after that the Cell width is 30 unit. And then the GetX returns 40.00125 which is 10.00125+30

SetX()


	SetX(float x)

Defines the abscissa of the current position. If the passed value is negative, it is relative to the right of the page.

x

The value of the abscissa.


	$pdf = new FPDF();
	$pdf->SetFont('Arial','B',16);
	
	$pdf->AddPage();
	$pdf->SetX(30);
	$x = $pdf->GetX();
	$pdf->Cell(0, 10, $x, 1, 1);

	$pdf->Output('helo.pdf', 'D');

As you can see, SetX doesn't include margin. SetX counts from the left edge of the page.

GetY()

	
	float GetY()

Returns the ordinate of the current position.

	
	$pdf = new FPDF();
	$pdf->SetFont('Arial','B',16);
	
	$pdf->AddPage();
	$x = $pdf->GetY();
	$pdf->Cell(0, 10, $x, 1, 1);
	$x = $pdf->GetY();
	$pdf->Cell(0, 10, $x, 1, 1);

	$pdf->Output('helo.pdf', 'D');

The first position is 10.00125, as the Cell is has the height of 10, the next position becomes 20.00125, that is 10+10.00125.

SetY()

	
	SetY(float y [, boolean resetX])

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.

y

The value of the ordinate.

resetX

Whether to reset the abscissa. Default value: true. If it is true, then the SetX will be reset and will go to the beginning.


	$pdf = new FPDF();
	$pdf->SetFont('Arial','B',16);
	
	$pdf->AddPage();
	$pdf->SetY(-50);
	$x = $pdf->GetY();
	$pdf->Cell(0, 10, $x, 1, 1);

	$pdf->Output('helo.pdf', 'D');

As you can see we have set the y abscissa with a negative value, which is the relative to the bottom edge of the page.

SetXY


	SetXY(float x, float y)

Defines the abscissa and ordinate of the current position. If the passed values are negative, they are relative respectively to the right and bottom of the page.

x

The value of the abscissa.

y

The value of the ordinate.

SetMargins()

	
	SetMargins(float left, float top [, float right])

Defines the left, top and right margins. By default, they equal 1 cm. Call this method to change them.

left

Specifies the left margin.

top

Specifies the top margin.

right

Specifies the right margin.

SetLeftMargin()

	
	SetLeftMargin(float margin)

Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin.

SetTopMargin()

	
	SetTopMargin(float margin)

Defines the top margin. The method can be called before creating the first page.

SetRightMargin()

	
	SetRightMargin(float margin)

Defines the right margin. The method can be called before creating the first page.

SetDisplayMode()

	
	SetDisplayMode(mixed zoom [, string layout])

Defines the way the document is to be displayed by the viewer. The zoom level can be set: pages can be displayed entirely on screen, occupy the full width of the window, use real size, be scaled by a specific zooming factor or use viewer default (configured in the Preferences menu of Adobe Reader). The page layout can be specified too: single at once, continuous display, two columns or viewer default.

zoom

The zoom to use. It can be one of the following string values:

layout

The page layout. Possible values are: