Collect

Inheritance: java.lang.Object

public class Collect

Represents a group of methods intended to collect model objects of different types from Presentation.


Presentation pres = new Presentation("pres.pptx");
 try {
     for (IShape shape : Collect.shapes(pres))
     {
         // ... change shape formatting or other properties
     }
 } finally {
     if (pres != null) pres.dispose();
 }

Constructors

Constructor Description
Collect()

Methods

Method Description
shapes(Presentation pres) Collects all instances of Shape in the Presentation.

Collect()

public Collect()

shapes(Presentation pres)

public static System.Collections.Generic.IGenericEnumerable<Shape> shapes(Presentation pres)

Collects all instances of Shape in the Presentation.


Presentation pres = new Presentation("pres.pptx");
 try {
     for (IShape shape : Collect.shapes(pres))
     {
         // if the shape is AutoShape, add a black solid border
         if (shape instanceof AutoShape)
         {
             AutoShape autoShape = (AutoShape)shape;
             autoShape.getLineFormat().setStyle(LineStyle.Single);
             autoShape.getLineFormat().setWidth(10f);
             autoShape.getLineFormat().getFillFormat().setFillType(FillType.Solid);
             autoShape.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.black);
         }
     }
     pres.save("pres-out.pptx", SaveFormat.Pptx);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

Parameter Type Description
pres Presentation Presentation to collect shapes

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.slides.Shape> - Collection of all shapes that contain in the presentation