I created a report in odoo 8 using RML, everything is good. but when i print the report, caracteres are printed from left to right. I tried with drawRightString
but nothing does appears on the PDF.
I used openerp-rtl
module but I noticed no changes.
What can i do to print it in RTL mode.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Generally people working on Right to left text on Arbic Language.
so in this case you just install the below python-bidi package :
https://pypi.python.org/pypi/python-bidi/
python-bidi package is helpful to set the Pure python implementation of the BiDi layout algorithm.
And also add the bidi directory in your OpenERP report dir and use the get_display(string)
method for making your sting convert into the arbic formate and also use with the arabic_reshaper
class
You can do some thing like
import arabic_reshaper
from bidi.algorithm import get_display
def get_arabic_string(string):
reshaped_text = arabic_reshaper.reshape(string)
bidi_text = get_display(reshaped_text)
return bidi_text
Just need to use the get_arbic_string function in your rml file and set it on rml and pass the sting as arbic formate.
just check another source :