-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdf.php
50 lines (44 loc) · 1.19 KB
/
pdf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
require_once "fpdf/fpdf.php";
// Cabecera de la Página
class PDF extends FPDF{
function Header()
{
// Imagen Logo
$this->Image('logo.png',10,6,30);
// Tipo y Tamaño Fuente
$this->SetFont('Arial','B',16);
// Move to the right
$this->Cell(100);
// Title
$this->Cell(80,10,utf8_decode('PDF Title'),0,0,'C',0);
// Line break
$this->Ln(35);
//Cell width,Cell height,String to print, border,salto linea, centrado,fill cell
}
// Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','I',8);
// Page number
$this->Cell(0,10,utf8_decode('Página ') .$this->PageNo().'/{nb}',0,0,'C');
}
function BodyText($file)
{
// Read text file
$txt = file_get_contents($file);
// Times 12
$this->SetFont('Times','',12);
// Output justified text
$this->MultiCell(0,5,$txt);
// Line break
$this->Ln();
// Mention in italics
$this->SetFont('','I');
$this->Cell(0,5,'(fin del capitulo)');
}
}
?>