0

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 from another document?

Community
  • 1
  • 1
Keith Pinson
  • 7,835
  • 7
  • 61
  • 104

1 Answers1

0

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"))
Keith Pinson
  • 7,835
  • 7
  • 61
  • 104