相关疑难解决方法(0)

无法使用 docx 更改“标题 1”字体名称

我正在使用以下脚本:

header = self.document.add_paragraph(style='Heading 1')
header.style.font.name = 'Arial'
header.style.font.size = Pt(16)
header.add_run('Header One')
Run Code Online (Sandbox Code Playgroud)

结果是“Header One”得到“Calibri”。

python-2.7 python-docx

4
推荐指数
1
解决办法
3131
查看次数

标签 统计

python-2.7 ×1

python-docx ×1