我希望每次运行代码时在 Word 文档中附加一个徽标文件,
理想情况下,代码应如下所示:
from docx import Document
document = Document()
logo = open('logo.eps', 'r') #the logo path that is to be attached
document.add_heading('Underground Heating Oil Tank Search Report', 0) #simple heading that will come bellow the logo in the header.
document.save('report for xyz.docx') #saving the file
Run Code Online (Sandbox Code Playgroud)
这在 python-docx 中可能吗?还是我应该尝试其他库来做到这一点?如果可能的话请告诉我怎么做