com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class Collect

  • java.lang.Object
    • com.aspose.slides.Collect


  • public class Collect
    extends java.lang.Object

    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();
     }
     
    • Constructor Summary

      Constructors 
      Constructor and Description
      Collect() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static com.aspose.ms.System.Collections.Generic.IGenericEnumerable<Shape> shapes(Presentation pres)
      Collects all instances of Shape in the Presentation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Collect

        public Collect()
    • Method Detail

      • shapes

        public static com.aspose.ms.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:
        pres - Presentation to collect shapes
        Returns:
        Collection of all shapes that contain in the presentation