We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Slides for Java vs ApachePOI XSLF

Hello Support,

I am evaluating both technologies mentioned in the Subject and I am glad that Aspose.Slides is much more adopted than ApachePOI. At the moment I am playing with both libraries and checking them based on my requirements which I will need to draw shapes and connectors as part of an export to pptx project I’ve been given.

- How do I draw free form shapes using Aspose.Slides for Java? ApachePOI provides a XSLFFreeFormShape which accepts Path2D, but the implementation is poor and when I did quadTo it throws ClassCastException based on the Bezier Curve.

- Another point that I need to cover based on my requirements is the OffSet. For instance, I have two rectangles connected by ConnectorShape, then we visually see the line touching the shape. I would like to set the OffSet of the connector then the line won’t touch the shape. I couldn’t find it in Both. Apache POI docs is poor.

Thank you.

Hi Guilherme,

Thanks for your interest in Aspose.Slides.

I have observed your comments and like to share that Aspose.Slides offers to add different shapes including curves. It also supports adding connectors between shapes using easy code samples. However, at the moment, the support for editing multiple curve points is unavailable in Aspose.Slides at the moment. An issue with ID SLIDESJAVA-35604 has been created as new feature request in our issue tracking system to provide the requested support. This thread has been linked with the issue so that you may be automatically notified once the support will be available.

Many Thanks,

Hi Mudassir,

Thank you for you quick reply.

I checked all the available ShapeType but I still need to draw some custom shapes to cover my requirements. I am going to wait for the issued to be resolved :). Brilliant.

About my second question: do you know if I can set the OffSet properties of an connectorShape ? I know that powerpoint supports it, but I couldn’t find any example that supports it, also in the code there’s nothing straight forward like setOffset!

Best Regards.

Hi Guilherme,

I have observed your comments regarding second point. Can you please share a sample PowerPoint presentation describing offset in connector shapes. I will discuss that further with our product team to check its possibility of implementation and share further feedback with you.

Many Thanks,

Dear Mudassir.

I have added some attachments, so the file no-offset.png has 2 rectangles and 1 ellipse (1px x 1px), then I created two connectorsShape. One connector starts on the left rectangle and ends on the ellipse. The same for the other rectangle. Then you can see the connector line is touching the shapes. By setting the offset of the connector, the line does not touch the shape anymore. Now check the image offset.png (I tested on Keynote, but I also saw these property on PP). I set the offset 10px, then the connector is 10px detached from the shape.

This is my example class.
public class Connectors {
public static void main(String[] args) {
Presentation input = new Presentation();
IShapeCollection shapes = input.getSlides().get_Item(0).getShapes();
IAutoShape rectangle = shapes.addAutoShape(ShapeType.Rectangle, 100, 100, 100, 70);
IAutoShape ellipse = shapes.addAutoShape(ShapeType.Ellipse, 400, 100, 1, 1);
IAutoShape rectangleRight = shapes.addAutoShape(ShapeType.Rectangle, 600, 100, 100, 70);
IConnector connector = shapes.addConnector(ShapeType.StraightConnector1, 1,1,1,1, true);
connector.setStartShapeConnectedTo (rectangle);
IConnector connector2 = shapes.addConnector(ShapeType.StraightConnector1, 1,1,1,1, true);
connector2.setStartShapeConnectedTo (rectangleRight);
input.save(“offset.pptx”, SaveFormat.Pptx);
Thank you

Hi Guilherme,

Thank you for sharing the feedback. I have investigated on my end inside PowerPoint and have not been able to find any option of connector offset. Can you please share any example in form of PowerPoint presentation achieving desired result. What is possible in KeyNote is not necessarily applicable to PowerPoint. Please share the feedback so that I may help you further in this regard.

Many Thanks,

Hi Mudassir,

You’re right. PowerPoint does not support offset. I saved one pptx generated by KeyNote that I have set the offset, but when I open it in PowerPoint again, looks like it just “ignore it” and draw the normal connector

Sorry about that.
Thank you

The issues you have found earlier (filed as SLIDESJAVA-35604) have been fixed in this update.