2019-04 Update Mailversand
Archiv
Auswertung
admin
balance_img
fancybox
images
mail
standort
#prints
FCKeditor
anschreiben
images
prints
#alt
Praxisstellen-Dateien
decoders
doc
font
tutorial
20k_c1.txt
20k_c2.txt
calligra.afm
calligra.php
calligra.ttf
calligra.z
countries.txt
index.htm
logo.png
logo_pb.png
makefont.php
tuto1.htm
tuto1.php
tuto2.htm
tuto2.php
tuto3.htm
tuto3.php
tuto4.htm
tuto4.php
tuto5.htm
tuto5.php
tuto6.htm
tuto6.php
tuto7.htm
tuto7.php
FAQ.htm
LICENSE
NOTICE
Praxisstellen.doc
Praxisstellen.htm
Zustimmung.doc
changelog.txt
demo.php
fpdf.css
fpdf.php
fpdf_tpl.php
fpdi.php
fpdi_pdf_parser.php
histo.htm
install.txt
newpdf.pdf
pdf_context.php
pdf_gen.php
pdf_parser.php
pdfdoc.pdf
praxisstellen.pdf
praxisstellen.php
wrapper_functions.php
zustimmung.pdf
zustimmung.php
Praxisstellen-Dateien
decoders
doc
filters
font
listen
makefont
tutorial
02_Liste_Erstpruefer_Student_Zweitpruefer.php
03_Liste_Zweitpruefer_Student_Erstpruefer.php
FAQ.htm
LICENSE
NOTICE
Praxisstellen.doc
Praxisstellen.htm
Zustimmung.doc
as_utf_class.php
blanko_ludwigsburg.pdf
changelog.txt
class.fpdf_table.php
class.multicelltag.php
class.string_tags.php
deckblatt.pdf
deckblatt.php
deckblatt_doz.php
demo.php
ex.php
fpdf.css
fpdf.php
fpdf_tpl.php
fpdi.php
fpdi_bridge.php
fpdi_pdf_parser.php
histo.htm
install.txt
newpdf.pdf
pdf_context.php
pdf_gen.php
pdf_parser.php
pdfdoc.pdf
praxisstellen.pdf
praxisstellen.php
sozuweisung.php
table_def.inc
table_def_kehl.inc
teilnehmer.php
teilnehmer_alt.php
teilnehmer_neu.php
wrapper_functions.php
zustimmung.pdf
zustimmung.php
browserSniffer.js
dynCalendar.css
dynCalendar.js
hauptframe.php
hauptframe_jahr.php
index.php
index_frame.htm
jahrgang.php
kennwortwechsel.php
logout.php
mail_teilnehmer.php
mail_teilnehmer_alt.php
mail_teilnehmer_neu.php
menuframe.php
pers_daten_ver.php
termine.php
topframe.php
vert_bereich.php
stud
#pdf_gen.php
#pdf_gen_alt.php
#pdf_gen_ges_lubu.php
#pdf_gen_kehl.php
#pdf_gen_kehl_alt.php
#pdf_gen_kehl_neu.php
#pdf_gen_neu.php
++ Printqueue zurücksetzen.txt.lnk
.gitignore
Auswertung_besuchte Stellen der Studs - alle Jahrgänge.sql
Auswertung_besuchte Stellen der Studs.sql
Pflicht.sql
Trigger.sql
VIEW_stan_zuw_so.sql
VIEW_stan_zuw_so_neu.sql
anz_anm.php
bearbeiten_neu.php
historie.php
historie_alt.php
historie_neu.php
index.php
index_db.php
index_ldap.php
ldap_info.php
ldap_info_hsnet.php
login.css
menuframe.php
styles_pc.css
51 lines
6.1 KiB
HTML
Executable File
51 lines
6.1 KiB
HTML
Executable File
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
|
<TITLE>Header, footer, page break and image</TITLE>
|
|
<LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
|
|
</HEAD>
|
|
<BODY>
|
|
<H2>Header, footer, page break and image</H2>
|
|
Here is a two page example with header, footer and logo:
|
|
<BR>
|
|
<BR>
|
|
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
|
<NOBR><code><font color="#000000">
|
|
<?php<br><font class="kw">require(</font><font class="str">'fpdf.php'</font><font class="kw">);<br><br>class </font>PDF <font class="kw">extends </font>FPDF<br><font class="kw">{<br></font><font class="cmt">//Page header<br></font><font class="kw">function </font>Header<font class="kw">()<br>{<br> </font><font class="cmt">//Logo<br> </font>$<font class="kw">this-></font>Image<font class="kw">(</font><font class="str">'logo_pb.png'</font><font class="kw">,</font>10<font class="kw">,</font>8<font class="kw">,</font>33<font class="kw">);<br> </font><font class="cmt">//Arial bold 15<br> </font>$<font class="kw">this-></font>SetFont<font class="kw">(</font><font class="str">'Arial'</font><font class="kw">,</font><font class="str">'B'</font><font class="kw">,</font>15<font class="kw">);<br> </font><font class="cmt">//Move to the right<br> </font>$<font class="kw">this-></font>Cell<font class="kw">(</font>80<font class="kw">);<br> </font><font class="cmt">//Title<br> </font>$<font class="kw">this-></font>Cell<font class="kw">(</font>30<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Title'</font><font class="kw">,</font>1<font class="kw">,</font>0<font class="kw">,</font><font class="str">'C'</font><font class="kw">);<br> </font><font class="cmt">//Line break<br> </font>$<font class="kw">this-></font>Ln<font class="kw">(</font>20<font class="kw">);<br>}<br><br></font><font class="cmt">//Page footer<br></font><font class="kw">function </font>Footer<font class="kw">()<br>{<br> </font><font class="cmt">//Position at 1.5 cm from bottom<br> </font>$<font class="kw">this-></font>SetY<font class="kw">(-</font>15<font class="kw">);<br> </font><font class="cmt">//Arial italic 8<br> </font>$<font class="kw">this-></font>SetFont<font class="kw">(</font><font class="str">'Arial'</font><font class="kw">,</font><font class="str">'I'</font><font class="kw">,</font>8<font class="kw">);<br> </font><font class="cmt">//Page number<br> </font>$<font class="kw">this-></font>Cell<font class="kw">(</font>0<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Page '</font><font class="kw">.</font>$<font class="kw">this-></font>PageNo<font class="kw">().</font><font class="str">'/{nb}'</font><font class="kw">,</font>0<font class="kw">,</font>0<font class="kw">,</font><font class="str">'C'</font><font class="kw">);<br>}<br>}<br><br></font><font class="cmt">//Instanciation of inherited class<br></font>$pdf<font class="kw">=new </font>PDF<font class="kw">();<br></font>$pdf<font class="kw">-></font>AliasNbPages<font class="kw">();<br></font>$pdf<font class="kw">-></font>AddPage<font class="kw">();<br></font>$pdf<font class="kw">-></font>SetFont<font class="kw">(</font><font class="str">'Times'</font><font class="kw">,</font><font class="str">''</font><font class="kw">,</font>12<font class="kw">);<br>for(</font>$i<font class="kw">=</font>1<font class="kw">;</font>$i<font class="kw"><=</font>40<font class="kw">;</font>$i<font class="kw">++)<br> </font>$pdf<font class="kw">-></font>Cell<font class="kw">(</font>0<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Printing line number '</font><font class="kw">.</font>$i<font class="kw">,</font>0<font class="kw">,</font>1<font class="kw">);<br></font>$pdf<font class="kw">-></font>Output<font class="kw">();<br></font>?>
|
|
</font>
|
|
</code></NOBR></TD></TR></TABLE><P></P>
|
|
<SCRIPT>
|
|
<!--
|
|
if(document.location.href.indexOf('http:')==0)
|
|
{
|
|
document.write("<P CLASS='demo'><A HREF='tuto2.php' TARGET='_blank' CLASS='demo'>[Demo]</A></P>");
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
This example makes use of the <A HREF='../doc/header.htm'>Header()</A> and <A HREF='../doc/footer.htm'>Footer()</A> methods to process page headers and
|
|
footers. They are called automatically. They already exist in the FPDF class but do nothing,
|
|
therefore we have to extend the class and override them.
|
|
<BR>
|
|
<BR>
|
|
The logo is printed with the <A HREF='../doc/image.htm'>Image()</A> method by specifying its upper-left corner and
|
|
its width. The height is calculated automatically to respect the image proportions.
|
|
<BR>
|
|
<BR>
|
|
To print the page number, a null value is passed as the cell width. It means that the cell
|
|
should extend up to the right margin of the page; it is handy to center text. The current page
|
|
number is returned by the <A HREF='../doc/pageno.htm'>PageNo()</A> method; as for the total number of pages, it is obtained
|
|
by means of the special value <TT>{nb}</TT> which will be substituted on document closure
|
|
(provided you first called <A HREF='../doc/aliasnbpages.htm'>AliasNbPages()</A>).
|
|
<BR>
|
|
Note the use of the <A HREF='../doc/sety.htm'>SetY()</A> method which allows to set position at an absolute location in
|
|
the page, starting from the top or the bottom.
|
|
<BR>
|
|
<BR>
|
|
Another interesting feature is used here: the automatic page breaking. As soon as a cell would
|
|
cross a limit in the page (at 2 centimeters from the bottom by default), a break is performed
|
|
and the font restored. Although the header and footer select their own font (Arial), the body
|
|
continues with Times. This mechanism of automatic restoration also applies to colors and line
|
|
width. The limit which triggers page breaks can be set with <A HREF='../doc/setautopagebreak.htm'>SetAutoPageBreak()</A>.
|
|
</BODY>
|
|
</HTML>
|