Browse Source

New bades

master
Julian M. Kunkel 4 years ago
parent
commit
dfd6dafba2
  1. 64
      badges/create-sticky-bades.py
  2. 0
      phd-thesis/Appendices/AppendixA.tex
  3. 0
      phd-thesis/Appendices/AppendixTemplate.tex
  4. 0
      phd-thesis/Chapters/Chapter1.tex
  5. 0
      phd-thesis/Chapters/ChapterTemplate.tex
  6. 0
      phd-thesis/Figures/Electron.pdf
  7. 0
      phd-thesis/MastersDoctoralThesis.cls
  8. 0
      phd-thesis/example.bib
  9. 0
      phd-thesis/main.tex

64
badges/create-sticky-bades.py

@ -0,0 +1,64 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import traceback
from Reader import *
# Copyright by JK 2018
# License: MIT
# https://www.reportlab.com/docs/reportlab-userguide.pdf
if len(sys.argv) > 1:
event = sys.argv[1]
else:
event = "Use ARG1 as event"
print("This script generates a template for the Avery L7173 form")
data = loadData()
doc = PDFDoc("badges-A4", 21, 29.7)
c = 0
for p in data:
try:
# check for image
if c % 10 == 0:
offset_x = 0.1
elif c % 10 == 5:
offset_x = 10.2+0.3+0.1
if c % 5 == 0:
offset_y = 0.1
else:
offset_y += 5.95
img = doc.subImage(offset_x, offset_y , 10.2, 5.95)
img.addImg("../assets/background", 0, 0, 0.7)
img.addImg("../assets/reading-logo", 0.1, 0.8, 0.1)
img.addKeyVal("Department of", 0.37, 0.87, size=0.035, color=(0,0.2,0), font="Helvetica")
img.addKeyVal("Computer Science", 0.37, 0.81, size=0.05, color=(0,0.2,0), font="Helvetica")
#img.addImg("logo", 0.7, 0.8, 0.1)
#img.drawRectBorder(0, 0, 1, 1)
size = 0.2
if len(p[0]) > 12:
size = 0.2 * 12 / len(p[0])
img.addKeyValCenter(p[0], 0.5, 0.5, size=size, font="Helvetica")
img.addKeyValCenter(p[1], 0.5, 0.37, size=0.07, font="Helvetica-Oblique")
img.addKeyValCenter(event, 0.5, 0.2, size=0.07, font="Helvetica-Oblique")
if c % 10 == 9:
doc.newpage()
c+=1
except:
print("Unexpected error when processing %s" %(p))
traceback.print_exc()
doc.save()
print("In printing dialog set the defaults for scaling but use the manual feed!")

0
thesis/Appendices/AppendixA.tex → phd-thesis/Appendices/AppendixA.tex

0
thesis/Appendices/AppendixTemplate.tex → phd-thesis/Appendices/AppendixTemplate.tex

0
thesis/Chapters/Chapter1.tex → phd-thesis/Chapters/Chapter1.tex

0
thesis/Chapters/ChapterTemplate.tex → phd-thesis/Chapters/ChapterTemplate.tex

0
thesis/Figures/Electron.pdf → phd-thesis/Figures/Electron.pdf

0
thesis/MastersDoctoralThesis.cls → phd-thesis/MastersDoctoralThesis.cls

0
thesis/example.bib → phd-thesis/example.bib

0
thesis/main.tex → phd-thesis/main.tex

Loading…
Cancel
Save