I\'m trying to generate a pdf from template using this snippet:
def write_pdf(template_src, context_dict): template = get_template(template_src) context
Try replacing
pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("UTF-8")), result)
with
pdf = pisa.pisaDocument(StringIO.StringIO(html), result, encoding='UTF-8')
Or checkout this answer to html to pdf for a Django site?