我正在尝试使用 Reportlab (python 3.5.2) 将一些文本和数字写入 PDF,但似乎无法识别制表符,它被打印为黑色方块。下面的代码重现了这个问题。from reportlab.lib.pagesizes import letterfrom reportlab.pdfgen import canvasdef tabs_reportlab(): my_canvas = canvas.Canvas("tab_test.pdf", pagesize=letter) textobject = my_canvas.beginText() textobject.setTextOrigin(10, 730) textobject.setFont('Times-Roman', 12) textobject.textLine(text='A tab between each word.') my_canvas.drawText(textobject); my_canvas.save()if __name__ == '__main__': tabs_reportlab()它被打印为:A■tab■between■each■word我该如何处理?
添加回答
举报
0/150
提交
取消