Hi, i'm trying to get the positios of an image inserted into a writer
document but I don't know how do it.
I was trying this during a whole week, but i can't find how to do it. In
the PropertySet i haven't got any property for get the position of a image.
I'm using java, my imcomplete code it's:
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ...
File doc = new File("Doc1.doc");
XComponentContext xContext = Bootstrap.bootstrap();
XMultiComponentFactory xMCF = xContext.getServiceManager();
Object oRawDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
XDesktop oDesktop = (XDesktop) UnoRuntime.queryInterface(
XDesktop.class, oRawDesktop);
XComponentLoader xCompLoader = (XComponentLoader) UnoRuntime
.queryInterface(com.sun.star.frame.XComponentLoader.class,
oDesktop);
String sUrl = "file:///" + doc.getAbsolutePath();
// Cargar el documento en una nueva ventana oculta del XDesktop
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "Hidden";
loadProps[0].Value = new Boolean(true);
// Proporciona componentes sobre el documento cargado
XComponent xComp = xCompLoader.loadComponentFromURL(sUrl,
"_blank",
0, loadProps);
// Hacer casting del documento cargado a XTextDocument
XTextDocument tDoc = (XTextDocument) UnoRuntime.queryInterface(
XTextDocument.class, xComp);
XTextGraphicObjectsSupplier os =
(XTextGraphicObjectsSupplier) UnoRuntime
.queryInterface(XTextGraphicObjectsSupplier.class,
xComp);
XNameAccess as = os.getGraphicObjects();
String[] s = as.getElementNames();
//Get the first image of the document
Object o = (Object) as.getByName(s[0]);
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ...
Here I have the first image, now i want to get the position in the
document for this image, how I can get it? XPropertySet doesn't have any
attribute for this.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]