Line(float x1, float y1, float x2, float y2)
Draws a line between two points.
x1
Abscissa of first point.y1
Ordinate of first point.x2
Abscissa of second point.y2
Ordinate of second point.$pdf = new FPDF(); $pdf->SetFont('Arial','B',16); $pdf->AddPage(); $pdf->Line(30, 40, 60, 70); $pdf->Output('helo.pdf', 'D');
SetLineWidth()
can be used to specify the thickness of the line.
SetDrawColor()
can be used to specify the line color.
SetLineWidth(float width)
Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page.
The width.
$pdf = new FPDF(); $pdf->SetFont('Arial','B',16); $pdf->AddPage(); $pdf->SetLineWidth(5); $pdf->Line(30, 40, 60, 70); $pdf->Output('helo.pdf', 'D');
Rect(float x, float y, float w, float h [, string style])
Outputs a rectangle. It can be drawn (border only), filled (with no border) or both.
x
Abscissa of upper-left corner.y
Ordinate of upper-left corner.w
Width.h
Height.style
Style of rendering. Possible values are:
$pdf = new FPDF(); $pdf->SetFont('Arial','B',16); $pdf->AddPage(); $pdf->SetLineWidth(5); $pdf->Rect(30, 40, 30, 30); $pdf->Output('helo.pdf', 'D');
SetLineWidth()
can be used to specify the thickness of the frame.
SetFillColor()
can be used as background color.
SetDrawColor()
can be used to specify the frame color.