using jython and open office 2.4 to convert docs to pdf
Question: I completed a python script using pyuno which successfully converted a
document/ xls / rtf etc to a pdf. Then I needed to update a mssql database,
due to open office currently supporting python 2.3, it's ancientness, lacks
support for decent database libs. So I have resorted to using Jython, this way
im not burdened down by running inside OO python environment using an old
pyuno.

This also means that my conversion code is broken, and I need to now make use
of the java libraries instead of the pyuno libs.

> import com.sun.star.beans.PropertyValue as PropertyValue  
>  import com.sun.star.bridge.XUnoUrlResolver as XUnoUrlResolver  
>  import com.sun.star.comp.helper.Bootstrap as Bootstrap  
>  ->> import com.sun.star.frame.XComponentLoader as XComponentLoader  
>  ->> import com.sun.star.frame.XStorable as XStorable  
>  import com.sun.star.lang.XMultiComponentFactory as XMultiComponentFactory  
>  import com.sun.star.uno.UnoRuntime as UnoRuntime  
>  import com.sun.star.uno.XComponentContext as XComponentContext

The includes with the '->>' do not import the compiler does not recognise the
com.sun.star.frame cant see the 'frame' bit. These are the libs I have
included.

![alt text](http://www.freeimagehosting.net/uploads/eda5cda76d.jpg)

Some advice on this matter would be well received

> context = XComponentContext  
>  xMultiCompFactory = XMultiComponentFactory  
>  xcomponentloader = XComponentLoader
>
> //used in python  
>  ctx = None  
>  smgr = None  
>  doc = None  
>  url = None
>
> context = Bootstrap.bootstrap()  
>  xMultiCompFactory = self.context.getServiceManager()  
>  xcomponentloader = UnoRuntime.queryInterface(XComponentLoader.class,
> ....xMultiCompFactory.createInstanceWithContext("com.sun.star.frame.Desktop",
> context))
>
> file = "file:\\\" + file  
>  // also what is the equivalent of url = uno.systemPathToFileUrl(file) in
> Java so that I can make use of it to nicely format my path  
>  properties = []  
>  p = PropertyValue()  
>  p.Name = "Hidden"  
>  p.Value = True  
>  properties.append(p)  
>  properties = tuple(properties)  
>  doc = xcomponentloader.loadComponentFromURL(file, "_blank",0, properties)


Answer: And so it goes, according to this guy, you need some oil.... and it works like
a charm

<http://www.oooforum.org/forum/viewtopic.phtml?p=304263#304263>

include this lib C:\OpenOffice_24\program\classes\unoil.jar

