2
我嘗試了幾個星期來創建阿拉伯語的PDF報告,但我失敗了。 我使用ReportLab和兩個包來構建阿拉伯字符,即bidi.algorithm和arabic_reshaper。 在控制檯中,字符組織良好,但在pdf中只有黑色方塊。ReportLab:阿拉伯字符顯示爲黑色方塊。
import reshaper
from bidi.algorithm import get_display
heading = get_display(reshaper.reshape(unicode('العربية', encoding='utf-8')))
print heading
在控制檯輸出:العربية
但在生成的PDF文件:▀▀▀▀▀
預先感謝您。
請問您可以添加一個最小且可運行的代碼示例嗎? – Fookatchu
問題中的代碼是可運行的,但您應該安裝模塊:-Arabic-Reshaper和bidi.algorithm – Khairy