开发者

Add Section to OpenDocument Text file with ODFpy

开发者 https://www.devze.com 2023-04-11 07:14 出处:网络
I am using Python2.7 and ODFpy to write an OpenDocument Text (ODT) file. Is there a way using the existing ODFpy API to add sections (a la Format->Sections...) to the document? Is there a way to impor

I am using Python2.7 and ODFpy to write an OpenDocument Text (ODT) file. Is there a way using the existing ODFpy API to add sections (a la Format->Sections...) to the document? Is there a way to import them from another document and then populate them, or to otherwise fetch the styling fr开发者_如何学Pythonom another document?


A section can be added to a document by a method something like this:

from odf import text as odftext
from odf import opendocument
document = opendocument.OpenDocument()
document.text.addElement(odftext.Section(name="section1"))
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号