Is there a way to generate pdf containing non-ascii symbols with pisa from django template?

后端 未结 6 793
情歌与酒
情歌与酒 2021-02-05 08:11

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          


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 08:48

    This does work for me:

    pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("UTF-8")), result, encoding='UTF-8')
    

提交回复
热议问题