缩进看起来非常简单,终端会打印回正确的缩进,但相同的缩进不会反映在我保存的Word docx中。
我做错什么了吗
from docx import Document
from docx.shared import Inches
worddoc = Document()
paragraph = worddoc.add_paragraph('Left Indent Test')
paragraph.left_indent = Inches(.25)
print(paragraph.left_indent.inches)
worddoc.save('left_indent.docx')
这是一个文档错误
如果您使用新的API,它可以工作:
当
Paragraph
和ParagraphStyle
对象都使用ParagraphFormat
类时,left_indent
属性被移到了paragraph_format
子对象,这是一对夫妇释放回来的如果您将在GitHub上的
python-docx
问题跟踪程序中提交错误报告,我们将在下次访问时更新文档相关问题 更多 >
编程相关推荐