django - Pisa arabic rendering issue using xhtml2pdf and reportlab -
arabic goes wrong displayed on output pdf following code:
template = get_template(template_src) context = context(context_dict) html = template.render(context) result = stringio.stringio() pdf = pisa.pisadocument(stringio.stringio( html.encode(pdf_encoding)), result, encoding=pdf_encoding) # pdf_encoding = 'utf-8'
and in template set charset , fonts:
<meta http-equiv="content-type" content="text/html; charset=utf-8"> @font-face { font-family: amiriregular; src: url(/usr/share/fonts/opentype/fonts-hosny-amiri/amiri-regular.ttf); } body { font-family: amiriregular; }
the arabic text in snapshot supposed be:
ياسر حسن
have you found a solution?
ReplyDelete