-
Notifications
You must be signed in to change notification settings - Fork 1
/
coverPage.py
52 lines (40 loc) · 1.37 KB
/
coverPage.py
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
51
52
import fitz
def createCoverPage(event, clustering, trial):
#SETTING UP
doc = fitz.open()
page = doc.newPage()
#FORMATTING
headerRect = fitz.Rect(70, 160, 500, 700)
subHeaderRect = fitz.Rect(70, 330, 500, 700)
infoRect = fitz.Rect(70, 420, 500, 700)
namesRect = fitz.Rect(70, 600, 500, 700)
border = fitz.Rect(10,10,585,830)
border2 = fitz.Rect(20,20,575,820)
#TEXT
header = event
subHeader = clustering
infoText = trial
namesText = "Cristian Garces, Bradley Krakar, Jesse Ladyman, Rami Jaber"
#TEXTBOXES
rc = page.insertTextbox(headerRect, header,
align=fitz.TEXT_ALIGN_CENTER ,
fontsize = 40)
rc = page.insertTextbox(subHeaderRect, subHeader,
align=fitz.TEXT_ALIGN_CENTER ,
fontsize = 25)
rc = page.insertTextbox(infoRect, infoText,
align=fitz.TEXT_ALIGN_CENTER,
fontsize=20)
rc = page.insertTextbox(namesRect, namesText,
align=fitz.TEXT_ALIGN_CENTER ,
fontsize = 15)
#BORDER
shape = page.new_shape()
#DRAWING THE RECTANGLES
shape.draw_rect(border)
shape.draw_rect(border2)
#COMMITTING
shape.finish()
shape.commit()
# doc.save("title.pdf")
return doc