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

Free Support Forum - aspose.com

Polyline GeneralPath

Hi,


We are trying to update Aspose Slides for Java from version 2.6.0.2 to 8.0.0 to parse PPT files.

For Polyline shape ( Donut ), in 2.6.0.2 version the path sequence was Move, 4 Cubic curves, Close segment, Move, 4 Cubic curves, Close segment.
In 8.0.0 version, the path sequence is Move, 3 Cubic curves, Move, 3 Cubic curves.

Since it is a curved shape, we could not add a Close segment which draws a straight line which is absurd in this case.

Can you please provide a solution for the above issue ? The sample files are attached herewith.

Thanks,
Mani.
(Zoho Corp.)

Hi Mani,


I have observed the requirements shared by you and request you to please share the sample code to generate the presentation file using 2.6.0.2. I will try to port the same to Aspose.Slides for Java 8.0.0 to help you further in this regard.

Many Thanks,

Hi Mudassir,


The ppt file (donut.ppt) was created with MS Powerpoint 2003.

Thanks,
Mani

Hi Mani,

I have worked with the presentation file shared by you using Aspose.Slides for Java 8.5.0. I have been able to observe the following output on my end by using the sample code given below. It is the same output the is required on your end. Please try using the specified version on your end.

Output:

Segment is NewPolygon
Segment is Curve
Segment is Curve
Segment is Curve
Segment is Curve
Segment is ClosePolygon
Segment is NewPolygon
Segment is Curve
Segment is Curve
Segment is Curve
Segment is Curve
Segment is ClosePolygon


public static void addDonut()
{

String path=“D:\Aspose Data\”;
Presentation pres=new Presentation(path+“donut.ppt”);

Slide slide=pres.getSlideByPosition(1);

Shape sha =slide.getShapes().get_Item(0);

if(sha instanceof Polyline)
{
Polyline line=(Polyline)sha;

int[] segline = line.getSegments();
for(int i=0;i<segline.length;i++)
{
// System.out.println(“Segment is :”+segline[i]);
switch(segline[i])
{
case 0:
System.out.println(“Segment is Line”);
break;

case 1:
System.out.println(“Segment is Curve”);

break;

case 2:
System.out.println(“Segment is NewPolygon”);

break;
case 3:
System.out.println(“Segment is ClosePolygon”);

break;

}
}

}


}

Please share, if I may help you further in this regard.

Many Thanks,