用阿拉伯语在django中渲染PDF模板

问题描述 投票:0回答:1

我在用阿拉伯语单词渲染pdf模板时遇到问题,我使表格包含存储的类(商品)行,这是生成pdf的代码

def render_to_pdf(template_src, context_dict={}):
template = get_template(template_src)
html  = template.render(context_dict)
result = BytesIO()
pdf = pisa.pisaDocument(BytesIO(html.encode("iso-8859-6")), result)
if not pdf.err:
    return HttpResponse(result.getvalue(), content_type='application/pdf')
return None

在编码中,我输入了iso-8859-6,我搜索了阿拉伯语编码,然后尝试使用它,它无法正常工作,没有任何帮助,谢谢

python django pdf
1个回答
0
投票
好吧,您的终端很可能无法呈现结果,所以请在您的终端中尝试:
© www.soinside.com 2019 - 2024. All rights reserved.