-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdfci.py
More file actions
39 lines (34 loc) · 1.15 KB
/
Copy pathpdfci.py
File metadata and controls
39 lines (34 loc) · 1.15 KB
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
# -*- coding: utf-8 -*-
from fpdf import FPDF
class PDF(FPDF):
def header(this):
# Logo
#this.image('logo_pb.png',10,8,33)
# Arial bold 15
this.set_font('Arial','B',15)
# Move to the right
this.cell(80)
# Title
this.cell(30,10,'Title',1,0,'C')
# Line break
this.ln(20)
# Page footer
def footer(this):
# Position at 1.5 cm from bottom
this.set_y(-15)
# Arial italic 8
this.set_font('Arial','I',8)
# Page number
#this.cell(0,10,'Page '+str(this.PageNo())+'/{nb}',0,0,'C')
# Instanciation of inherited class
pdf=PDF()
pdf.alias_nb_pages()
pdf.add_page()
#pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
#pdf.set_font('DejaVu', '', 14)
#pdf.add_font('Arial', '', 'Arial.ttf', uni=True)
#pdf.set_font('Arial', '', 14)
pdf.set_font('Helvetica', '', 14)
for i in range(1,41):
pdf.cell(0,10,('çþþþöðüi')+str(i),0,1)
pdf.output('tuto2.pdf','F')