Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 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=UTF-8">
|
| 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->SetY(-15);
|
| 29 | // Select Arial italic 8
|
| 30 | $this->SetFont('Arial', 'I', 8);
|
| 31 | // Print current and total page numbers
|
| 32 | $this->Cell(0, 10, 'Page '.$this->PageNo().'/{nb}', 0, 0, 'C');
|
| 33 | }
|
| 34 | }
|
| 35 |
|
| 36 | $pdf = new PDF();
|
| 37 | $pdf->AliasNbPages();</code></pre>
|
| 38 | </div>
|
| 39 | <h2>See also</h2>
|
| 40 | <a href="pageno.htm">PageNo</a>,
|
| 41 | <a href="footer.htm">Footer</a>
|
| 42 | <hr style="margin-top:1.5em">
|
| 43 | <div style="text-align:center"><a href="index.htm">Index</a></div>
|
| 44 | </body>
|
| 45 | </html>
|