mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2026-02-06 15:15:15 +01:00
Initiale Version
This commit is contained in:
33
Kapitel_5/Lektion_11/pdf_loesung/2_mehrere_seiten.php
Normal file
33
Kapitel_5/Lektion_11/pdf_loesung/2_mehrere_seiten.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/fpdf/fpdf.php';
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
public function Header()
|
||||
{
|
||||
$this->Image('logo.png', 10, 6, 40);
|
||||
$this->SetFont('Arial', 'B', 15);
|
||||
$this->Cell(80);
|
||||
$this->Cell(50, 10, 'Rheinwerk Verlag', 1, 0, 'C');
|
||||
$this->Ln(20);
|
||||
}
|
||||
|
||||
public function Footer()
|
||||
{
|
||||
$this->SetY(-15);
|
||||
$this->SetFont('Times', 'I', 8);
|
||||
$this->Cell(0, 10, 'Seite ' . $this->PageNo() . ' von {nb}', 0, 0, 'C');
|
||||
}
|
||||
}
|
||||
|
||||
$pdf = new PDF();
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Times', '', 12);
|
||||
|
||||
for ($i = 1; $i <= 40; $i++) {
|
||||
$pdf->Cell(0, 10, 'Ausgabe der Zeile ' . $i, 0, 1);
|
||||
}
|
||||
|
||||
$pdf->Output();
|
||||
Reference in New Issue
Block a user