如何使用python在word(.docx)中插入具有特定Y值的图像以垂直对齐?

2024-09-30 10:30:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用python创建(.docx)文件,我想插入内联图像,但它需要垂直对齐,以便在段落内看起来更好 我正在使用python中的docx包,我正在使用

document = Document()
paragraph = document.add_paragraph(''' This is test paragaph''')
run = paragraph.add_run()
run.add_picture('test.png')
paragraph.add_run(''' after the image''')

document.save('addImage.docx')

Tags: 文件runtest图像addpngisthis

热门问题