Hello,
I have found an interesting issue.
Start libreoffice as following:
$ /usr/bin/libreoffice4.0 "--accept=socket,host=localhost,port=2002;urp;"
draw.odg contains some asian text. Let's export it using using
GraphicExportFilter. I created a sample python script for this
(drawpages.py):
$ cp draw.odg /tmp/
$ python drawpages.py
Now open /tmp/draw.png. Everything is displayed correctly.
Now start libreoffice in headless mode:
/usr/bin/libreoffice4.0 "--accept=socket,host=localhost,port=2002;urp;"
--headless
Repeat steps above. If you open /tmp/draw.png, you will notice that all
asian characters are mangled.
For convenience I attached drawpages.py and other documents. For clarity
here it is:
--------------------------
import uno
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext)
context = resolver.resolve("uno:socket,host=localhost,port=2002;"
"urp;StarOffice.ComponentContext")
desktop = context.ServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", context)
url = uno.systemPathToFileUrl('/tmp/draw.odg')
doc = desktop.loadComponentFromURL(url, "_blank", 0, ())
draw_pages = doc.getDrawPages()
page = draw_pages.getByIndex(0)
gf = context.ServiceManager.createInstanceWithContext(
"com.sun.star.drawing.GraphicExportFilter", context)
gf.setSourceDocument(page)
url = uno.systemPathToFileUrl('/tmp/draw.png')
pv1 = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
pv1.Name, pv1.Value = "URL", url
pv2 = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
pv2.Name, pv2.Value = "MediaType", "image/png"
args = (pv1, pv2)
gf.filter(args)
--------------------------
--
Regards,
Maxim
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.