能否使用borb
编写阿拉伯字母?
我尝试了borb
中的14种可能的字体,但没有一种能够显示阿拉伯字母。
from borb.pdf import Document
from borb.pdf import PDF
from borb.pdf import Page
from borb.pdf import Paragraph
from borb.pdf import SingleColumnLayout
def main():
# Create an empty Document.
pdf = Document()
# Add an empty Page.
page = Page()
pdf.append_page(page)
# Use a PageLayout (SingleColumnLayout in this case).
layout = SingleColumnLayout(page)
# Add a Paragraph
layout.add(Paragraph("Hello World", font="Helvetica"))
# Store the PDF.
with open(Path('output.pdf'), 'wb') as pdf_file_handle:
PDF.dumps(pdf_file_handle, pdf)