Ask Your Question
3

Reading from Writer using Uno (and Python) [closed]

asked 2013-04-12 00:14:50 +0100

_savage gravatar image

I hope somebody has an answer to this question. Given a loaded document

local = uno.getComponentContext()
resolver = local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local)
context = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
document = desktop.loadComponentFromURL("file:///Users/savage/test.odt" ,"_blank", 0, ())

How do I now actually read text from the document, preferably including some of the styling information like headings, or footnotes?

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-23 02:14:04.264008

1 Answer

Sort by » oldest newest most voted
0

answered 2014-05-17 12:21:24 +0100

jonathan.scholbach gravatar image

I don't know how it works with Uno but for reading (and parsing) an odt-file with Python have a look at this: Extract and Parse ODF Files with Python

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-12 00:14:50 +0100

Seen: 1,053 times

Last updated: May 17 '14