Page 1 of 1

How to Draw Flowchart Programmatically in Open Office Draw

Posted: Sat Nov 09, 2013 8:39 pm
by alok21
Using UNOruntime api I want to generate flowchart programmatically in Open Office Draw.How can I do this.Pls suggest.Using follwing code I was able to open Open Office Draw but was unable to proceed further:-

String oooExeFolder = "C:\\Program Files\\LibreOffice 4.0\\program\\";

XComponentContext xContext = BootstrapSocketConnector.bootstrap(oooExeFolder);
//XComponentContext xContext = Bootstrap.bootstrap();

// Get the remote office service manager
XMultiComponentFactory xMCF = xContext.getServiceManager();

// Get the root frame (i.e. desktop) of openoffice framework.
Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext);

// Desktop has 3 interfaces. The XComponentLoader interface provides ability to load components.
XComponentLoader xCLoader = ( XComponentLoader ) UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);

String officeType = "sdraw";
document = xCLoader.loadComponentFromURL("private:factory/" + officeType, "_blank", 0, new PropertyValue[0]);

Re: How to Draw Flowchart Programmatically in Open Office Dr

Posted: Sat Nov 09, 2013 9:21 pm
by Villeroy
This requires a whole library on top of an adequate set of templates, styles and custom shapes.