blob: 7afa38535d05e237cf2a5c1b61cc0d7a79a87d7f [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<!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>
12Defines an alias for the total number of pages. It will be substituted as the document is
13closed.
14<h2>Parameters</h2>
15<dl class="param">
16<dt><code>alias</code></dt>
17<dd>
18The 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
36$pdf = new PDF();
37$pdf-&gt;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>