<div dir="ltr">I've just also created a bug report.<div><br></div><div><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72036">https://bugs.freedesktop.org/show_bug.cgi?id=72036</a><br><div><br></div><div style>Thanks</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 November 2013 15:51, Maxim Lacrima <span dir="ltr"><<a href="mailto:lacrima.maxim@gmail.com" target="_blank">lacrima.maxim@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I have found an interesting issue.</div><div><br></div><div>Start libreoffice as following:</div>
<div><br></div><div>$ /usr/bin/libreoffice4.0 "--accept=socket,host=localhost,port=2002;urp;"</div>
<div><br></div><div>draw.odg contains some asian text. Let's export it using using GraphicExportFilter. I created a sample python script for this (drawpages.py):</div><div><br></div><div>$ cp draw.odg /tmp/</div>
<div>$ python drawpages.py</div><div><br></div><div>Now open /tmp/draw.png. Everything is displayed correctly.</div><div><br></div><div>Now start libreoffice in headless mode:</div><div><br></div><div>/usr/bin/libreoffice4.0 "--accept=socket,host=localhost,port=2002;urp;" --headless</div>
<div><br></div><div>Repeat steps above. If you open /tmp/draw.png, you will notice that all asian characters are mangled.</div><div><br></div><div>For convenience I attached drawpages.py and other documents. For clarity here it is:</div>
<div>--------------------------</div><div><div>import uno</div><div><br></div><div>localContext = uno.getComponentContext()</div><div>resolver = localContext.ServiceManager.createInstanceWithContext(</div><div> "com.sun.star.bridge.UnoUrlResolver", localContext)</div>
<div><br></div><div>context = resolver.resolve("uno:socket,host=localhost,port=2002;"</div><div> "urp;StarOffice.ComponentContext")</div><div><br></div><div>desktop = context.ServiceManager.createInstanceWithContext(</div>
<div> "com.sun.star.frame.Desktop", context)</div><div><br></div><div>url = uno.systemPathToFileUrl('/tmp/draw.odg')</div><div>doc = desktop.loadComponentFromURL(url, "_blank", 0, ())</div>
<div><br></div><div>draw_pages = doc.getDrawPages()</div><div>page = draw_pages.getByIndex(0)</div><div><br></div><div>gf = context.ServiceManager.createInstanceWithContext(</div><div> "com.sun.star.drawing.GraphicExportFilter", context)</div>
<div>gf.setSourceDocument(page)</div><div><br></div><div>url = uno.systemPathToFileUrl('/tmp/draw.png')</div><div>pv1 = uno.createUnoStruct("com.sun.star.beans.PropertyValue")</div><div>pv1.Name, pv1.Value = "URL", url</div>
<div><br></div><div>pv2 = uno.createUnoStruct("com.sun.star.beans.PropertyValue")</div><div>pv2.Name, pv2.Value = "MediaType", "image/png"</div><div><br></div><div>args = (pv1, pv2)</div><div>
<br></div><div>gf.filter(args)</div></div><div>--------------------------<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Maxim</div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Maxim</div>
</div>