The variable pdfCanvas is referenced before it is assigned. The only occurrence is in the function snbToPdf. Not sure how it could ever work like this for this reason, or that I am missing something.
Also, a Python 3 version would be nice. If you fix the above I can make a PR.