[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/inc/fpdf/doc/ -> acceptpagebreak.htm (source)

   1  <HTML>
   2  <HEAD>
   3  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
   4  <TITLE>AcceptPageBreak</TITLE>
   5  <LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
   6  </HEAD>
   7  <BODY>
   8  <H2>AcceptPageBreak</H2>
   9  <TT><B>boolean</B> AcceptPageBreak()</TT>
  10  <H4 CLASS='st'>Version</H4>
  11  1.4
  12  <H4 CLASS='st'>Description</H4>
  13  Whenever a page break condition is met, the method is called, and the break is issued or not
  14  depending on the returned value. The default implementation returns a value according to the
  15  mode selected by SetAutoPageBreak().
  16  <BR>
  17  This method is called automatically and should not be called directly by the application.
  18  <H4 CLASS='st'>Example</H4>
  19  The method is overriden in an inherited class in order to obtain a 3 column layout:
  20  <BR>
  21  <BR>
  22  <TABLE WIDTH="100%" BGCOLOR="#E0E0E0"><TR><TD>
  23  <TT>
  24  class PDF extends FPDF<BR>
  25  {<BR>
  26  var $col=0;<BR>
  27  <BR>
  28  function SetCol($col)<BR>
  29  {<BR>
  30  &nbsp;&nbsp;&nbsp;&nbsp;//Move position to a column<BR>
  31  &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;col=$col;<BR>
  32  &nbsp;&nbsp;&nbsp;&nbsp;$x=10+$col*65;<BR>
  33  &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetLeftMargin($x);<BR>
  34  &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetX($x);<BR>
  35  }<BR>
  36  <BR>
  37  function AcceptPageBreak()<BR>
  38  {<BR>
  39  &nbsp;&nbsp;&nbsp;&nbsp;if($this-&gt;col&lt;2)<BR>
  40  &nbsp;&nbsp;&nbsp;&nbsp;{<BR>
  41  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Go to next column<BR>
  42  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetCol($this-&gt;col+1);<BR>
  43  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetY(10);<BR>
  44  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;<BR>
  45  &nbsp;&nbsp;&nbsp;&nbsp;}<BR>
  46  &nbsp;&nbsp;&nbsp;&nbsp;else<BR>
  47  &nbsp;&nbsp;&nbsp;&nbsp;{<BR>
  48  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Go back to first column and issue page break<BR>
  49  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetCol(0);<BR>
  50  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<BR>
  51  &nbsp;&nbsp;&nbsp;&nbsp;}<BR>
  52  }<BR>
  53  }<BR>
  54  <BR>
  55  $pdf=new PDF();<BR>
  56  $pdf-&gt;Open();<BR>
  57  $pdf-&gt;AddPage();<BR>
  58  $pdf-&gt;SetFont('Arial','',12);<BR>
  59  for($i=1;$i&lt;=300;$i++)<BR>
  60  &nbsp;&nbsp;&nbsp;&nbsp;$pdf-&gt;Cell(0,5,&quot;Line $i&quot;,0,1);<BR>
  61  $pdf-&gt;Output();
  62  </TT>
  63  </TD></TR></TABLE><BR>
  64  <H4 CLASS='st'>See also</H4>
  65  <A HREF="setautopagebreak.htm">SetAutoPageBreak()</A>.
  66  <H6></H6>
  67  <HR>
  68  <DIV ALIGN="CENTER"><A HREF="index.htm">Index</A></DIV>
  69  </BODY>
  70  </HTML>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7