Document creation with odfpy

D

DarkBlue

Hello

I hope here is the right place to ask this:

I use the python odfpy library to create and
load an odt file , however, spaces
in the passed in text are removed.

http://opendocumentfellowship.org/development/projects/odfpy

python2.4


from odf.opendocument import OpenDocumentText
from odf.style import Style, TextProperties
from odf.text import H, P, Span

def SaveIt(MYTEXT) :
doc = OpenDocumentText()
for line in MYTEXT:
p = P(text=line)
doc.text.addElement(p)
doc.save('mynewfile.odt')


MYTEXT is a list containing lines from a wx.TextCtrl
if a line is:

abcabc abcabc abcabc

the result in the odt file looks like:

abcabc abcabc abcabc



Is there anything I am doing wrong ?



Thanks
Db
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,787
Messages
2,569,631
Members
45,338
Latest member
41Pearline46

Latest Threads

Top