在 reportlab 的 ParagraphStyle 中,可以使用 firstLineIndent 属性来设置首行缩进。具体方法是在创建 ParagraphStyle 对象时,将 firstLineIndent 设置为需要的缩进量(以毫米为单位)。如:

from reportlab.lib.styles import ParagraphStyle

# 设置首行缩进为 20 毫米
style = ParagraphStyle(name='normal', firstLineIndent=20)

如果需要首行左突出,可以将 firstLineIndent 设置为负数(如

更多推荐