mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-29 01:59:19 +01:00
71 lines
2.3 KiB
HTML
Executable File
71 lines
2.3 KiB
HTML
Executable File
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
|
<TITLE>AcceptPageBreak</TITLE>
|
|
<LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
|
|
</HEAD>
|
|
<BODY>
|
|
<H2>AcceptPageBreak</H2>
|
|
<TT><B>boolean</B> AcceptPageBreak()</TT>
|
|
<H4 CLASS='st'>Version</H4>
|
|
1.4
|
|
<H4 CLASS='st'>Description</H4>
|
|
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().
|
|
<BR>
|
|
This method is called automatically and should not be called directly by the application.
|
|
<H4 CLASS='st'>Example</H4>
|
|
The method is overriden in an inherited class in order to obtain a 3 column layout:
|
|
<BR>
|
|
<BR>
|
|
<TABLE WIDTH="100%" BGCOLOR="#E0E0E0"><TR><TD>
|
|
<TT>
|
|
class PDF extends FPDF<BR>
|
|
{<BR>
|
|
var $col=0;<BR>
|
|
<BR>
|
|
function SetCol($col)<BR>
|
|
{<BR>
|
|
//Move position to a column<BR>
|
|
$this->col=$col;<BR>
|
|
$x=10+$col*65;<BR>
|
|
$this->SetLeftMargin($x);<BR>
|
|
$this->SetX($x);<BR>
|
|
}<BR>
|
|
<BR>
|
|
function AcceptPageBreak()<BR>
|
|
{<BR>
|
|
if($this->col<2)<BR>
|
|
{<BR>
|
|
//Go to next column<BR>
|
|
$this->SetCol($this->col+1);<BR>
|
|
$this->SetY(10);<BR>
|
|
return false;<BR>
|
|
}<BR>
|
|
else<BR>
|
|
{<BR>
|
|
//Go back to first column and issue page break<BR>
|
|
$this->SetCol(0);<BR>
|
|
return true;<BR>
|
|
}<BR>
|
|
}<BR>
|
|
}<BR>
|
|
<BR>
|
|
$pdf=new PDF();<BR>
|
|
$pdf->Open();<BR>
|
|
$pdf->AddPage();<BR>
|
|
$pdf->SetFont('Arial','',12);<BR>
|
|
for($i=1;$i<=300;$i++)<BR>
|
|
$pdf->Cell(0,5,"Line $i",0,1);<BR>
|
|
$pdf->Output();
|
|
</TT>
|
|
</TD></TR></TABLE><BR>
|
|
<H4 CLASS='st'>See also</H4>
|
|
<A HREF="setautopagebreak.htm">SetAutoPageBreak()</A>.
|
|
<H6></H6>
|
|
<HR>
|
|
<DIV ALIGN="CENTER"><A HREF="index.htm">Index</A></DIV>
|
|
</BODY>
|
|
</HTML>
|