aliasnbpages.htm 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. <H2>AliasNbPages</H2>
  10. <TT>AliasNbPages([<B>string</B> alias])</TT>
  11. <H4 CLASS='st'>Version</H4>
  12. 1.4
  13. <H4 CLASS='st'>Description</H4>
  14. Defines an alias for the total number of pages. It will be substituted as the document is
  15. closed.
  16. <H4 CLASS='st'>Parameters</H4>
  17. <TT><U>alias</U></TT>
  18. <BLOCKQUOTE>
  19. The alias. Default value: <TT>{nb}</TT>.
  20. </BLOCKQUOTE>
  21. <H4 CLASS='st'>Example</H4>
  22. <TABLE WIDTH="100%" BGCOLOR="#E0E0E0"><TR><TD>
  23. <TT>
  24. class PDF extends FPDF<BR>
  25. {<BR>
  26. function Footer()<BR>
  27. {<BR>
  28. &nbsp;&nbsp;&nbsp;&nbsp;//Go to 1.5 cm from bottom<BR>
  29. &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetY(-15);<BR>
  30. &nbsp;&nbsp;&nbsp;&nbsp;//Select Arial italic 8<BR>
  31. &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;SetFont('Arial','I',8);<BR>
  32. &nbsp;&nbsp;&nbsp;&nbsp;//Print current and total page numbers<BR>
  33. &nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo().'/{nb}',0,0,'C');<BR>
  34. }<BR>
  35. }<BR>
  36. <BR>
  37. $pdf=new PDF();<BR>
  38. $pdf-&gt;AliasNbPages();
  39. </TT>
  40. </TD></TR></TABLE><BR>
  41. <H4 CLASS='st'>See also</H4>
  42. <A HREF="pageno.htm">PageNo()</A>,
  43. <A HREF="footer.htm">Footer()</A>.
  44. <HR STYLE="margin-top:1.2em">
  45. <DIV ALIGN="CENTER"><A HREF="index.htm">Index</A></DIV>
  46. </BODY>
  47. </HTML>