Public API and Backwards Incompatible Changes in Aspose.Slides for .NET 14.9.0

Public API Changes

Inheritance from ICollection and Generic IEnumerable Interfaces Added to ISmartArtNodeCollection

The class Aspose.Slides.SmartArt.SmartArtNodeCollection (and the related interface Aspose.Slides.SmartArt.ISmartArtNodeCollection) inherit the generic interface IEnumerable and interface ICollection.

SmartArtLayoutType.Custom Enum Value Added

The Custom SmartArt layout type represents a diagram with a custom template. Custom diagrams can only be loaded from a presentation file and can’t be created via the ShapeCollection.AddSmartArt(x, y, width, height, SmartArtLayoutType.Custom) method.

SmartArtShape Class and ISmartArtShape Interface Added

The Aspose.Slides.SmartArt.SmartArtShape class (and its interface Aspose.Slides.SmartArt.ISmartArtShape) give access to individual shapes in a SmartArt diagram. SmartArtShape can be used to change FillFormat, LineFormat, adding Hyperlinks and other tasks.

SmartArtShapeCollection Class, ISmartArtShapeCollection Interface and ISmartArtNode.Shapes Property Added

The Aspose.Slides.SmartArt.SmartArtShapeCollection class (and its interface Aspose.Slides.SmartArt.ISmartArtShapeCollection) add access to individual shapes in a SmartArt diagram. The collection contains shapes associated with SmartArtNode. The SmartArtNode.Shapes property returns collections of all shapes associated with the node.

Methods for Saving Slides with Page Numbers Keeping Added

The following methods have been added:

  • void IPresentation.Save(string fname, int[] slides, SaveFormat format);
  • void IPresentation.Save(string fname, int[] slides, SaveFormat format, ISaveOption options);
  • void IPresentation.Save(Stream stream, int[] slides, SaveFormat format);
  • void IPresentation.Save(Stream stream, int[] slides, SaveFormat format, ISaveOption options);

These methods allow developers to save specified presentation slides to PDF, XPS, TIFF, HTML formats. The ‘slides’ array is used to specify page numbers, starting from 1. Save(string fname, int[] slides, SaveFormat format);


 Presentation presentation = new Presentation(presentationFileName);

int[] slides = new int[] { 2, 3, 5 }; //Array of slides positions

presentation.Save(outFileName, slides, SaveFormat.Pdf);

Methods for Replacing Images Added to PPImage, IPPImage

New methods added:

  • IPPImage.ReplaceImage(byte[] newImageData)
  • IPPImage.ReplaceImage(Image newImage)
  • IPPImage.ReplaceImage(IPPImage newImage)

 Presentation presentation = new Presentation(presentation.pptx);

//First method

byte[] data = File.ReadAllBytes(image0.jpeg);

IPPImage oldImage = presentation.Images[0];

oldImage.ReplaceImage(data);

//Second method

Image newImage = Image.FromFile(image1.png);

oldImage = presentation.Images[1];

oldImage.ReplaceImage(newImage);

//Third method

oldImage = presentation.Images[2];

oldImage.ReplaceImage(presentation.Images[3]);

presentation.Save(presentation_out.pptx, SaveFormat.Pptx);