Cannot use GraphicExportFilter from external python script (crash)

tvi thomas at
Sun May 4 07:28:16 PDT 2014


I'm trying to render slides from a PowerPoint presentation using a
GraphicExportFilter, from a python script. However I'm experimenting crashes
at various levels. My investigations have led me to the internals of LO
hence the posting to the Dev list. I first tried the Users list, but was
advised to try here instead -- sorry if you read it twice.

I'm using LibreOffice 4.0.4 from CentOS repositories.

You can download the script from  here
, and the test presentation from  here

Here is the outline of my python 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.
This is easily worked around by wrapping a call to InitVCL() in a small
python module.

*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

Hence *second question*: am I correctly passing the page object around? I
have tried passing the XShapes interface instead, without more luck.

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?


View this message in context:
Sent from the Dev mailing list archive at

More information about the LibreOffice mailing list