from fpdf import FPDF
import bidi.algorithm
from arabic_reshaper import reshape
def add_pdf():
ft = FPDF()
txt = u"السلام عليكم"
ar_txt = reshape(txt)
bd_txt = bidi.algorithm.get_display(ar_txt)
ft.add_page()
ft.add_font("arb",'','arb.ttf',uni=True)
ft.set_font("arb",size=30)
ft.write(8,bd_txt)
ft.output("ft.pdf")
add_pdf()
جربت سابقا وظهرت لي المشكله هذي
PS C:\Users\expert\Desktop\python> & c:/Users/expert/Desktop/python/env/Scripts/python.exe c:/Users/expert/Desktop/python/test_pdf.py
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65163
warnings.warn("cmap value too big/small: %s" % cm)
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65201
warnings.warn("cmap value too big/small: %s" % cm)
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65223
warnings.warn("cmap value too big/small: %s" % cm)
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65239
warnings.warn("cmap value too big/small: %s" % cm)
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65241
warnings.warn("cmap value too big/small: %s" % cm)
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65257
warnings.warn("cmap value too big/small: %s" % cm)
C:\Users\expert\Desktop\python\env\Lib\site-packages\fpdf\ttfonts.py:670: UserWarning: cmap value too
big/small: -65266
warnings.warn("cmap value too big/small: %s" % cm)