Aspose.Slides for .NET 19.5 Release Notes

Key Summary Category
SLIDESNET-41051 Time spending evaluation for PDF conversion Investigation
SLIDESNET-41059 Aspose.Slides for .NET: Rasterization or vectorization of Shapes without text Feature
SLIDESNET-41015 Obtain default table background through API Feature
SLIDESNET-40727 Support for Convert SVG images to shapes Feature
SLIDESNET-40856 Support for Size represents property for Bubble chart Feature
SLIDESNET-40730 Support for Office 365 in Aspose.Slides Feature
SLIDESNET-40237 Support for hiding left slide thumbnails pane in generated PPT Feature
SLIDESNET-40870 Support for comments replies in Aspose.Slides Feature
SLIDESNET-39057 Support to set chart external data source workbook path Feature
SLIDESNET-40852 Support for Funnel charts and 2D map charts - funnel chart Feature
SLIDESNET-41034 Page numbers are incorrect when rendering with speaker notes Bug
SLIDESNET-41049 The icon of OLE embedded object is changed after click on it Bug
SLIDESNET-41081 PDF Bullets not shown generated by Aspose.Slides Bug
SLIDESNET-40823 PPTX to PDF - unwanted bullets occur before text Bug
SLIDESNET-40892 The label text is placed within the chart in the output PDF Bug
SLIDESNET-35995 The text shall consist of two lines on clouds shape in serialized PPT presentation Bug
SLIDESNET-36251 InvalidOperationException on saving presentation Bug
SLIDESNET-37504 TextAutoFit.Normal is not working when saving as PPT Bug
SLIDESNET-41037 PPT not properly converted to JPG Bug
SLIDESNET-40991 Field Footer Null using Aspose.Slides Bug
SLIDESNET-40969 Chart workbook gets corrupt on updating Bug
SLIDESNET-35336 Different in Bullet Color for PPT and PPTX file Bug
SLIDESNET-41020 Hyperlinks are not working in cloned presentation Bug
SLIDESNET-36891 Strikethrough missing in exported PPT presentation Bug
SLIDESNET-40979 Connector is not connected to a shape inside the group Bug
SLIDESNET-41060 Wrong chart rendering Bug
SLIDESNET-40962 Charts missing in generated PDF Bug
SLIDESNET-37505 ParagraphFormat.setMarginRight can not work on PPT Bug
SLIDESNET-40993 Edit data on powerpoint chart created through Slides.Net gets this error Bug
SLIDESNET-39621 Slide not properly rendered Bug
SLIDESNET-41058 Exception on converting slide into SVG Bug
SLIDESNET-41080 PPT not properly converted to PDF Bug
SLIDESNET-38475 Text size is changed after saving PPT Bug
SLIDESNET-41045 Character spacing lost in generated HTML Bug
SLIDESNET-41075 Gradient effects are not getting applied properly Bug
SLIDESNET-41040 Formatting of speakernotes is incorrect Bug
SLIDESNET-40731 ZlibException on loading presentation Bug
SLIDESNET-40757 PPTX not properly converted to PDF Bug
SLIDESNET-40871 ODP file not properly converted to PPTX Bug
SLIDESNET-40755 Chart is improperly rendered in generated PDF and HTML Bug

Public API Changes

IComment.ParentComment property has been added

A new property ParentComment has been added to IComment interface and Comment class.

It allows to get or set the parent comment, thus creating a dialog in the form of a hierarchy of comments and replies.

Pay attention that Remove method of IComment interface removes the comment with all its replies.

Note. If setting ParentComment leads to a circular reference, the exception of type PptxEditException will be thrown.

The code snippet below shows a sample of adding some comments and some replies to them:

using (Presentation pres = new Presentation())
{
    // Add comment
    ICommentAuthor author1 = pres.CommentAuthors.AddAuthor("Author_1", "A.A.");
    IComment comment1 = author1.Comments.AddComment("comment1", pres.Slides[0], new PointF(10, 10), DateTime.Now);

    // Add reply for comment1
    ICommentAuthor author2 = pres.CommentAuthors.AddAuthor("Autror_2", "B.B.");
    IComment reply1 = author2.Comments.AddComment("reply 1 for comment 1", pres.Slides[0], new PointF(10, 10), DateTime.Now);
    reply1.ParentComment = comment1;

    // Add reply for comment1
    IComment reply2 = author2.Comments.AddComment("reply 2 for comment 1", pres.Slides[0], new PointF(10, 10), DateTime.Now);
    reply2.ParentComment = comment1;

    // Add reply to reply
    IComment subReply = author1.Comments.AddComment("subreply 3 for reply 2", pres.Slides[0], new PointF(10, 10), DateTime.Now);
    subReply.ParentComment = reply2;

    IComment comment2 = author2.Comments.AddComment("comment 2", pres.Slides[0], new PointF(10, 10), DateTime.Now);
    IComment comment3 = author2.Comments.AddComment("comment 3", pres.Slides[0], new PointF(10, 10), DateTime.Now);

    IComment reply3 = author1.Comments.AddComment("reply 4 for comment 3", pres.Slides[0], new PointF(10, 10), DateTime.Now);
    reply3.ParentComment = comment3;

    // Display hierarchy on console
    ISlide slide = pres.Slides[0];
    var comments = slide.GetSlideComments(null);
    for (int i = 0; i < comments.Length; i++)
    {
        IComment comment = comments[i];
        while (comment.ParentComment != null)
        {
            Console.Write("\t");
            comment = comment.ParentComment;
        }

        Console.Write("{0} : {1}", comments[i].Author.Name, comments[i].Text);
        Console.WriteLine();
    }

    // Remove comment1 and all its replies
    comment1.Remove();
}

The normal view consists of three content regions: the slide itself, a side content region, and a bottom content region. Properties pertaining to the positioning of the different content regions. This information allows the application to save its view state to the file, so that when reopened the view is in the same state as when the presentation was last saved.

Property IViewProperties.NormalViewProperties has been added to provide access to normal view properties of presentation. 

INormalViewProperties, INormalViewRestoredProperties interfaces and its descendants, SplitterBarStateType enum have been added. 

todo:image_alt_text

INormalViewProperties

Represents normal view properties.

Property ShowOutlineIcons specifies whether the application should show icons if displaying outline content in any of the content regions of normal view mode.

Property SnapVerticalSplitter specifies whether the vertical splitter should snap to a minimized state when the side region is sufficiently small.

Property PreferSingleView specifies whether the user prefers to see a full-window single-content region over the standard normal view with three content regions.If enabled, the application may choose to display one of the content regions in the entire window.

Properties VerticalBarState and HorizontalBarState specify the state that the horizontal or vertical splitter bar should be shown in. A horizontal splitter bar separates the slide from the content region below the slide, vertical splitter bar separates the slide from the side content region. Possible values are: SplitterBarStateType.Minimized, SplitterBarStateType.Maximized and SplitterBarStateType.Restored.

Properties RestoredLeft and RestoredTop specify the sizing of the top or side slide region of the normal view, when SplitterBarStateType.Restored value applied for VerticalBarState and HorizontalBarState accordingly*.*

INormalViewRestoredProperties

Specifies the sizing of the slide region ((width when a child of RestoredTop, height when a child of RestoredLeft) of the normal view, when the region is of a variable restored size(neither minimized nor maximized). 

Property DimensionSize  specifies the size of the slide region (width when a child of restoredTop, height when a child of restoredLeft).

Property AutoAdjust specifies whether the size of the side content region should compensate for the new size when resizing the window containing the view within the application

using (Presentation pres = new Presentation())
{
    pres.ViewProperties.NormalViewProperties.HorizontalBarState = SplitterBarStateType.Restored;
    pres.ViewProperties.NormalViewProperties.VerticalBarState = SplitterBarStateType.Maximized;

    pres.ViewProperties.NormalViewProperties.RestoredTop.AutoAdjust = true;
    pres.ViewProperties.NormalViewProperties.RestoredTop.DimensionSize = 80;
    pres.ViewProperties.NormalViewProperties.ShowOutlineIcons = true;

    pres.Save("presentation.pptx", SaveFormat.Pptx);
}

New IOleObjectFrame .SubstitutePictureTitle property has been added

A new property SubstitutePictureTitle has been added to IOleObjectFrame interface and OleObjectFrame class. It allows to get, set or change the caption of an OLE icon:

/// <summary>
/// Returns or set the title for OleObject icon.
/// Read/write <see cref="string"/>.
/// </summary>
/// <remarks>
/// When IsObjectIcon == false this value is ignored.
/// The string can be truncated according to the size of the Ole icon.
/// </remarks>
string SubstitutePictureTitle { get; set; }

The code snippet below shows a sample of creating Excel object and setting its caption:

string oleSourceFile = "ExcelObject.xlsx";
string oleIconFile = "Image.png";

using (Presentation pres = new Presentation())
{
    IPPImage image = null;
    ISlide slide = pres.Slides[0];

    // Add Ole objects
    byte[] allbytes = File.ReadAllBytes(oleSourceFile);
    IOleObjectFrame oof = slide.Shapes.AddOleObjectFrame(20, 20, 50, 50, "Excel.Sheet.12", allbytes);
    oof.IsObjectIcon = true;

    // Add image object
    byte[] imgBuf = File.ReadAllBytes(oleIconFile);
    using (MemoryStream ms = new MemoryStream(imgBuf))
    {
        image = pres.Images.AddImage(new Bitmap(ms));
    }
    oof.SubstitutePictureFormat.Picture.Image = image;

    // Set caption to OLE icon
    oof.SubstitutePictureTitle = "Caption example";
}

Note. When property IsObjectIcon of an IOleObjectFrame is set to value of false then SubstitutePictureTitle property is ignored.

Pay attention, that the string value of SubstitutePictureTitle may be truncated according to the size of the Ole icon that represents the OLE object.

Support for the representation of bubble size values has been added.

Property BubbleSizeRepresentation has been added to IChartSeries, IChartSeriesGroup interfaces, and related classes. 

BubbleSizeRepresentation specifies how the bubble size values are represented in the bubble chart. Possible values are: BubbleSizeRepresentationType.Area and BubbleSizeRepresentationType.Width.

Accordingly, BubbleSizeRepresentationType enum has been added to specify the possible ways to represent data as bubble chart sizes.

using (Presentation pres = new Presentation())
{
    IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Bubble, 50, 50, 600, 400, true);

    chart.ChartData.SeriesGroups[0].BubbleSizeRepresentation = BubbleSizeRepresentationType.Width;

    pres.Save("Presentation.pptx", SaveFormat.Pptx);
}


Support of converting SVG images into group of shapes has been added.

Since version 19.5 Aspose.Slides supports converting SVG images into group of shapes. 

New ISvgImage interface and SvgImage class were added

New ISvgImage interface was added to represent SVG image:

/// <summary>
/// Represents an SVG image.
/// </summary>
[ComVisible(true), Guid("8BB43C22-78D1-4032-A149-82FCD3992F0F"), CsToCppPorter.CppVirtualInheritance("System.Object")]
public interface ISvgImage
{
       /// <summary>
       /// Returns SVG content.
       /// Read-only <see cref="string"/>.
       /// </summary>
       string SvgContent { get; }

       /// <summary>
       /// Returns SVG data.
       /// Read-only <see cref="T:byte[]"/>.
       /// </summary>
       byte[] SvgData { get; }

       /// <summary>
       /// Return callback interface used to resolve external resources during SVG documents import.
       /// Read-only <see cref="IExternalResourceResolver"/>.
       /// </summary>
       IExternalResourceResolver ExternalResourceResolver { get; }

       /// <summary>
       /// Returns base URI of the specified SVG. Used to resolve relative links.
       /// Read-only <see cref="string"/>.
       /// </summary>
       string BaseUri { get; }
}

AddImage method has been added to IImageCollection interface and ImageCollection class

New AddImage method has been added to IImageCollection interface and ImageCollection class:

/// <summary>
/// Add an image to a presentation from SVG object.
/// </summary>
/// <param name="svgImage">Svg image object <see cref="ISvgImage"/></param>
/// <returns>Added image.</returns>
/// <exception cref="ArgumentNullException">When svgImage parameter is null.</exception>
IPPImage AddImage(ISvgImage svgImage);

These methods provide ability to insert Svg fragment to the presentation’s image collection:

using (var p = new Presentation())
{
    string svgContent = File.ReadAllText(svgPath);
    ISvgImage svgImage = new SvgImage(svgContent);
    IPPImage ppImage = p.Images.AddImage(svgImage);
    p.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, ppImage.Width, ppImage.Height, ppImage);
    p.Save(outPptxPath, SaveFormat.Pptx);
}
using (var p = new Presentation())
{
    string svgContent = File.ReadAllText(new Uri(new Uri(baseDir), "image1.svg").AbsolutePath);
    ISvgImage svgImage = new SvgImage(svgContent, new ExternalResourceResolver(), baseDir);
    IPPImage ppImage = p.Images.AddImage(svgImage);
    p.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, ppImage.Width, ppImage.Height, ppImage);
    p.Save(outPptxPath, SaveFormat.Pptx);
}

Pay attention that methods IPPImage AddFromSvg(string svgContent) and IPPImage AddFromSvg(string svgContent, IExternalResourceResolver externalResResolver, string baseUri) marked now as obsolete and will be deleted from API since version 19.10.

Property SvgImage property has been added to IPPImage interface and PPImage class

New property SvgImage have been to IPPImage interface and PPImage class:

/// <summary>
/// Returns or sets ISvgImage object <see cref="ISvgImage"/>
/// </summary>
/// <remarks>This value indicates that this image has been created from svg.</remarks>
ISvgImage SvgImage { get; set; }

AddGroupShape method has been added to IShapeCollection interface and IShapeCollection class

New AddGroupShape method has been added to IShapeCollection interface and ShapeCollection class:

/// <summary>
/// Creates a new GroupShape, fills it with converted shapes from SVG and adds it to the end of the collection.
/// </summary>
/// <param name="svgImage">Svg image object <see cref="ISvgImage"/></param>
/// <param name="x">The X coordinate for the left side of the shape group frame.</param>
/// <param name="y">The Y coordinate for the top side of the shape group frame.</param>
/// <param name="width">The width of the group of the shape group frame.</param>
/// <param name="height">The height of a group of the shape group frame.</param>
/// <returns>Created GroupShape object.</returns>
IGroupShape AddGroupShape(ISvgImage svgImage, float x, float y, float width, float height);

This method allows to convert SvgImage object that represents SVG data into group of shapes:

using (Presentation pres = new Presentation(pptxFileName))
{
    PictureFrame pFrame = pres.Slides[0].Shapes[0] as PictureFrame;
    ISvgImage svgImage = pFrame.PictureFormat.Picture.Image.SvgImage;
    if (svgImage != null)
    {
        // Convert svg image into group of shapes
        IGroupShape groupShape = pres.Slides[0].Shapes.AddGroupShape(svgImage, pFrame.Frame.X, pFrame.Frame.Y,
            pFrame.Frame.Width, pFrame.Frame.Height);
        // remove source svg image from presentation
        pres.Slides[0].Shapes.Remove(pFrame);
    }
}