使用ODFpy将部分添加到OpenDocument文本文件

时间:2011-10-07 19:40:25

标签: python odt opendocument odfpy

我使用Python2.7和ODFpy编写OpenDocument Text(ODT)文件。有没有办法使用现有的ODFpy API向文档添加部分(格式 - >部分......)?有没有办法从另一个文档导入它们然后填充它们,或者从另一个文档中获取样式?

1 个答案:

答案 0 :(得分:0)

可以通过以下方法将部分添加到文档中:

from odf import text as odftext
from odf import opendocument
document = opendocument.OpenDocument()
document.text.addElement(odftext.Section(name="section1"))
相关问题