Connectors between shapes are not yet supported. They *should* be instances or sub-classes of XSLFConnectorShape but I didn't yet research what properties need to be set to make them work.
My advise is to create a simple .pptx file with two shapes and a connector between them. Unzip the file, open slide.xml and see the structure. Compare it with a similar file created by POI, you want to look at CTConnector objects. Then grab low-level xml bean in your java code: XmlObject xml = connector .getXmlObject(); and modify it to match the reference .pptx created in PowerPoint. Hope it helps. Once you find how to set connectors, please share your knoledge on the mailing list or even better submit a patch. Yegor On Tue, Jul 17, 2012 at 8:04 PM, Nicolas Torneri <[email protected]> wrote: > Hello, > > I am using POI-XSLF to create .pptx documents. How can I create a connector > shape so that it is linked to two other shapes ? > > For example: > > // create new slideshow > XMLSlideShow ppt = new XMLSlideShow(); > // create new slide > XSLFSlide slide = ppt.createSlide(); > > // create a first random shape > XSLFAutoShape shape1 = slide.createAutoShape(); > shape1.setShapeType(XSLFShapeType.RECT); > shape1.setAnchor(new Rectangle(100, 100, 200, 300)); > shape1.setLineColor(new Color(0)); > shape1.setLineWidth(1.0f); > > // create a second random shape > XSLFAutoShape shape2 = slide.createAutoShape(); > shape2.setShapeType(XSLFShapeType.RECT); > shape2.setAnchor(new Rectangle(400, 100, 300, 200)); > shape2.setLineColor(new Color(0)); > shape2.setLineWidth(1.0f); > > // create a connector shape > XSLFConnectorShape connector = slide1.createConnector(); > connector.setShapeType(XSLFShapeType.LINE); > > Here, I would like connector to be bound to shape1 and shape2. How can I > achieve that ? > > Thanks in advance ! > Nicolas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
