From b009b7d368cb376788ba550784d21285cfbeded2 Mon Sep 17 00:00:00 2001 From: fossee-dell Date: Wed, 9 Aug 2017 14:55:43 +0530 Subject: Created proposal form --- pdf/fpdf/doc/acceptpagebreak.htm | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 pdf/fpdf/doc/acceptpagebreak.htm (limited to 'pdf/fpdf/doc/acceptpagebreak.htm') diff --git a/pdf/fpdf/doc/acceptpagebreak.htm b/pdf/fpdf/doc/acceptpagebreak.htm new file mode 100755 index 0000000..810aabd --- /dev/null +++ b/pdf/fpdf/doc/acceptpagebreak.htm @@ -0,0 +1,63 @@ + + + + +AcceptPageBreak + + + +

AcceptPageBreak

+boolean AcceptPageBreak() +

Description

+Whenever a page break condition is met, the method is called, and the break is issued or not +depending on the returned value. The default implementation returns a value according to the +mode selected by SetAutoPageBreak(). +
+This method is called automatically and should not be called directly by the application. +

Example

+The method is overriden in an inherited class in order to obtain a 3 column layout: +
+
class PDF extends FPDF
+{
+var $col = 0;
+
+function SetCol($col)
+{
+    // Move position to a column
+    $this->col = $col;
+    $x = 10+$col*65;
+    $this->SetLeftMargin($x);
+    $this->SetX($x);
+}
+
+function AcceptPageBreak()
+{
+    if($this->col<2)
+    {
+        // Go to next column
+        $this->SetCol($this->col+1);
+        $this->SetY(10);
+        return false;
+    }
+    else
+    {
+        // Go back to first column and issue page break
+        $this->SetCol(0);
+        return true;
+    }
+}
+}
+
+$pdf = new PDF();
+$pdf->AddPage();
+$pdf->SetFont('Arial','',12);
+for($i=1;$i<=300;$i++)
+    $pdf->Cell(0,5,"Line $i",0,1);
+$pdf->Output();
+
+

See also

+SetAutoPageBreak(). +
+
Index
+ + -- cgit