Cannot use GraphicExportFilter from external python script

Hi,

Me again.
As an alternative, I'm trying to render slides from a PowerPoint
presentation using a GraphicExportFilter, from a python script.
I'm using LibreOffice 4.0.4 from CentOS repositories.

Here is the outline of my script:

And the server invocation:

As such, the script segfaults when calling exporter.setSourceDocument().
With a little bit of debugging, I could track it down to a global
pImplSVData pointer being unitialized when instantiating a SolarMutexGuard
(love the name btw ;-)). This is easily worked around by calling a function
InitVCL() before.

*First question:* is the segfault normal, and is my workaround relevant? I'm
wondering if running in non interactive mode has something to do with the
unitialized Application/VCL stuff.

Even with the workaround, I get an IllegalArgumentException in
setSourceDocument(). With more debugging, it appears the culprits are the
following lines in UnoGraphicsExporter.cxx:

Strangely, the function correctly identifies the page object as a XDrawPage
(mxPage != NULL). However the SvxDrawPage assumption, which I don't
understand, does not hold (mpUnoPage == NULL), so the break statement is
triggered.

Hence *second question*: am I correctly passing the page object around? I
have tried passing the XShapes interface instead, without more luck. Is it
because my input file is a PPTX file?

Many thanks in advance.
The fact that I had to dig into the runtime with a debugger makes me think
that I have missed something obvious. But what is it?

Thomas

A quick follow-up: I've tested the same script against a new file in ODP
format (not converted from PPTX), and the same problem arises.

Hi Thomas,

Your question is very much dev related. Maybe you should raise it on the
dev mailing list or the dev irc channel ?

Alex