问题描述
我使用RML在odoo 8中创建了一个报告,一切都很好.但是,当我打印报告时,从左到右打印了卡通人物.我尝试使用drawRightString
,但PDF上没有任何内容.
我使用了openerp-rtl
模块,但没有发现任何变化.
我该怎么办才能在RTL模式下打印它.
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.
推荐答案
通常在Arbic Language上从右到左文本工作的人.
Generally people working on Right to left text on Arbic Language.
因此,在这种情况下,您只需安装以下python-bidi软件包:
so in this case you just install the below python-bidi package :
python-bidi软件包有助于设置BiDi布局算法的Pure python实现.
python-bidi package is helpful to set the Pure python implementation of the BiDi layout algorithm.
并在您的OpenERP报告目录中添加bidi目录,并使用get_display(string)
方法将您的ing虫转换为白色甲酸盐,并与arabic_reshaper
类一起使用
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
您可以做类似
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
只需在rml文件中使用get_arbic_string函数并将其设置在rml上,然后将其作为arbic甲酸盐传递即可.
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.
只需检查其他来源:
这篇关于如何在odoo 8上打印从右到左的报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!