2024-04-26 17:24:29 发布
网友
{x我想知道的是,如果你想在一个文档的中间对齐一个文本,我就可以把它垂直对齐。在
目前在库中无法执行此操作。但是,我发现,通过对齐现有文档中的文本,然后用pythondocx打开它,您可以简单地编辑文本,并且它将保留其格式。在
from docx import document document = Document('template.docx') # This just grabs the first paragraph, code assumes you've already applied formatting. document.paragraphs[0].text = "Example Text" document.save('output.docx')
目前在库中无法执行此操作。但是,我发现,通过对齐现有文档中的文本,然后用pythondocx打开它,您可以简单地编辑文本,并且它将保留其格式。在
相关问题 更多 >
编程相关推荐