diff --git a/badges/create-sticky-bades.py b/badges/create-sticky-bades.py new file mode 100755 index 0000000..2e7cf85 --- /dev/null +++ b/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!") diff --git a/thesis/Appendices/AppendixA.tex b/phd-thesis/Appendices/AppendixA.tex similarity index 100% rename from thesis/Appendices/AppendixA.tex rename to phd-thesis/Appendices/AppendixA.tex diff --git a/thesis/Appendices/AppendixTemplate.tex b/phd-thesis/Appendices/AppendixTemplate.tex similarity index 100% rename from thesis/Appendices/AppendixTemplate.tex rename to phd-thesis/Appendices/AppendixTemplate.tex diff --git a/thesis/Chapters/Chapter1.tex b/phd-thesis/Chapters/Chapter1.tex similarity index 100% rename from thesis/Chapters/Chapter1.tex rename to phd-thesis/Chapters/Chapter1.tex diff --git a/thesis/Chapters/ChapterTemplate.tex b/phd-thesis/Chapters/ChapterTemplate.tex similarity index 100% rename from thesis/Chapters/ChapterTemplate.tex rename to phd-thesis/Chapters/ChapterTemplate.tex diff --git a/thesis/Figures/Electron.pdf b/phd-thesis/Figures/Electron.pdf similarity index 100% rename from thesis/Figures/Electron.pdf rename to phd-thesis/Figures/Electron.pdf diff --git a/thesis/MastersDoctoralThesis.cls b/phd-thesis/MastersDoctoralThesis.cls similarity index 100% rename from thesis/MastersDoctoralThesis.cls rename to phd-thesis/MastersDoctoralThesis.cls diff --git a/thesis/example.bib b/phd-thesis/example.bib similarity index 100% rename from thesis/example.bib rename to phd-thesis/example.bib diff --git a/thesis/main.tex b/phd-thesis/main.tex similarity index 100% rename from thesis/main.tex rename to phd-thesis/main.tex