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

后端 未结 6 795
情歌与酒
情歌与酒 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条回答
  •  野性不改
    2021-02-05 08:50

    If you are calling createPDF instead of the pisaDocument method, you can use

    pisa.CreatePDF(html.encode('UTF-8'), response, link_callback=fetch_resources, encoding='UTF-8')
    

提交回复
热议问题