aliasnbpages.htm 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <title>AliasNbPages</title>
  6. <link type="text/css" rel="stylesheet" href="../fpdf.css">
  7. </head>
  8. <body>
  9. <h1>AliasNbPages</h1>
  10. <code>AliasNbPages([<b>string</b> alias])</code>
  11. <h2>Description</h2>
  12. Defines an alias for the total number of pages. It will be substituted as the document is
  13. closed.
  14. <h2>Parameters</h2>
  15. <dl class="param">
  16. <dt><code>alias</code></dt>
  17. <dd>
  18. The alias. Default value: <code>{nb}</code>.
  19. </dd>
  20. </dl>
  21. <h2>Example</h2>
  22. <div class="doc-source">
  23. <pre><code>class PDF extends FPDF
  24. {
  25. function Footer()
  26. {
  27. // Go to 1.5 cm from bottom
  28. $this-&gt;SetY(-15);
  29. // Select Arial italic 8
  30. $this-&gt;SetFont('Arial','I',8);
  31. // Print current and total page numbers
  32. $this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo().'/{nb}',0,0,'C');
  33. }
  34. }
  35. $pdf = new PDF();
  36. $pdf-&gt;AliasNbPages();</code></pre>
  37. </div>
  38. <h2>See also</h2>
  39. <a href="pageno.htm">PageNo()</a>,
  40. <a href="footer.htm">Footer()</a>.
  41. <hr style="margin-top:1.5em">
  42. <div style="text-align:center"><a href="index.htm">Index</a></div>
  43. </body>
  44. </html>