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 output: enter image description here

the arabic text in snapshot supposed be:

ياسر حسن 


Comments

Post a Comment

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -