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 and Description |
---|
Collect() |
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 . |
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(); }
pres
- Presentation to collect shapes