Skip to content

Instantly share code, notes, and snippets.

@veprbl
Last active August 29, 2015 14:05
Show Gist options
  • Save veprbl/f37a898636426f1c9b97 to your computer and use it in GitHub Desktop.
Save veprbl/f37a898636426f1c9b97 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
from reportlab.pdfgen import canvas
mm = 2.83464567
fms = [(0, 9), (0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 15), (0, 16), (0, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (8, 16), (0, 16), (0, 16), (0, 15), (0, 14), (0, 13), (0, 12), (0, 11), (0, 10), (0, 9)]
ch = 1
row = 0
for rowspec in fms:
c = canvas.Canvas("%i.pdf" % row, pagesize=(90 * mm, 9 * mm))
print "%2i:" % row,
for col in range(17):
if col in range(rowspec[0], rowspec[1]+1):
print " %3i" % ch,
c.setFont("Helvetica", 17)
c.drawString(70, 7, "CH%i(R%02iC%02i)" % (ch, row, col))
c.showPage()
else:
print " ",
ch += 1
print
c.save()
row += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment