Skip to content

Commit

Permalink
Adding in image and font
Browse files Browse the repository at this point in the history
The community image and a matching font for the cover letter are now included in PDF generation.
  • Loading branch information
hank committed Nov 18, 2018
1 parent 7336a19 commit 59b65a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/python/docs/export_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main(homeowners_fpath, outdir, fmat="TXT"):
reader = csv.reader(f)
reader = list(reader)
labels = reader[0]
print(labels)
# print(labels)

with open("letter_template.txt", "r") as template:
letter_template = template.read()
Expand Down
Binary file added code/python/docs/gables.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion code/python/docs/pdf_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ def pdf_convert(fname, data):
pdf = FPDF()
pdf.set_margins(left=10, top=15, right=10)
pdf.add_page()
pdf.set_font("Arial", size=12)
pdf.add_font('calibri', fname=r'c:\Windows\Fonts\calibri.ttf', uni=True)
pdf.image('gables.jpg', x=90, w=30)
pdf.set_font("calibri", size=12)
pdf.multi_cell(0, 5, txt=data)
pdf.output(fname)

0 comments on commit 59b65a0

Please sign in to comment.