Browse our Products

Aspose.Slides for .NET 19.3 Release Notes

KeySummaryCategory
SLIDESNET-40060Exception on converting PPTX to PDFInvestigation
SLIDESNET-40600Support for Text Highlighter featureFeature
SLIDESNET-40794Change the color of hyperlink text throughout a presentationFeature
SLIDESNET-40799Restricting local file system access when opening a documentFeature
SLIDESNET-40925Add encoding meta tag when saving into HTMLEnhancement
SLIDESNET-40612Setting for removing width and height attributes of SVG tag when saving as HTMLEnhancement
SLIDESNET-39845Aspose.Slides for .NET compliance with FIPS compliant algorithmsEnhancement
SLIDESNET-40956PPTX to PDF - image is missingBug
SLIDESNET-40866The font size is changed after PPT-to-PPT conversionBug
SLIDESNET-40891PPTX to PDF - legend bullets and position is not same as in the originalBug
SLIDESNET-40943PpptxReadException when reading the fileBug
SLIDESNET-40949PPTX to PDF - chart vertical lines are not renderedBug
SLIDESNET-40950PPTX to TIFF - almost every chart element is missingBug
SLIDESNET-40748Exception when saving as HTML with custom fontBug
SLIDESNET-40712Slide thumbnail has missing embedded Excel icon in thumbnailBug
SLIDESNET-40751PPTX to PDF not properly convertedBug
SLIDESNET-40785Exception on converting PPTX to TIFFBug
SLIDESNET-40814Incorrect text width in SVGBug
SLIDESNET-40821PptxReadException on loading presentationBug
SLIDESNET-40827PPTX not properly converted to PDFBug
SLIDESNET-40828Exception on loading presentationBug
SLIDESNET-40854Shade in text is lost after saving PPTBug
SLIDESNET-40855Text order is changed in PPTBug
SLIDESNET-40860Text position changed after loading and saving the presentation twiceBug
SLIDESNET-40861PPT Text box frame is shorter in saved presentationBug
SLIDESNET-40862Images change size and position in PPTBug
SLIDESNET-40869Exception on saving presentation to streamBug
SLIDESNET-40872ODP file not properly converted to PPTXBug
SLIDESNET-40873Fail during PPTM to PPT conversionBug
SLIDESNET-40877ODP file not properly converted to PPTXBug
SLIDESNET-40882ODP file not properly converted toBug
SLIDESNET-40884Blue shade is changed after saving PPTBug
SLIDESNET-40908Exception on loading PresentationBug
SLIDESNET-40916Issue with Bullets for Textbox shape in Presentation slideBug
SLIDESNET-40920PPTX not properly converted to PDFBug
SLIDESNET-40926Chart secondary axis is plotted on left sideBug
SLIDESNET-40944Wrong Shape Thumbnails generatedBug
SLIDESNET-40955Creating wrong slide in presentationsBug
SLIDESNET-33172Small image/icon is differ from original in exported PDFBug

Public API Changes

Hyperlink class changed to be mutable. Now it is possible to change values of the following properties which were read-only before:

  • IHyperlink.TargetFrame
  • IHyperlink.Tooltip
  • IHyperlink.History
  • IHyperlink.HighlightClick
  • IHyperlink.StopSoundOnClick

The code snippet below shows adding a hyperlink to the slide and editing its tooltip later:

using(Presentation presentation = new Presentation()) 
{
  IAutoShape shape1 = presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 100, 100, 600, 50, false);
  
  shape1.AddTextFrame("Aspose: File Format APIs");
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkClick = new Hyperlink("https://www.aspose.com/");
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkClick.Tooltip = "More than 70% Fortune 100 companies trust Aspose APIs";
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FontHeight = 32;

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

IHyperlink.ColorSource property has been added

A new property ColorSource has been added to IHyperlink interface and Hyperlink class.

It allows to get or set the source of hyperlink color, which could be obtained either from slide/presentation styles or corresponding PortionFormat properties. This is a new feature of PowerPoint 2019 and any changes made to this property will take affect only in PowerPoint 2019 or higher versions.

The code snippet below shows a sample of adding two hyperlinks with different colors to the same slide:

using(Presentation presentation = new Presentation()) 
{
  IAutoShape shape1 = presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 100, 100, 450, 50, false);
  shape1.AddTextFrame("This is a sample of colored hyperlink.");
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkClick = new Hyperlink("https://www.aspose.com/");
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkClick.ColorSource = HyperlinkColorSource.PortionFormat;
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.FillType = FillType.Solid;
  shape1.TextFrame.Paragraphs[0].Portions[0].PortionFormat.FillFormat.SolidFillColor.Color = Color.Red;

  IAutoShape shape2 = presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 100, 200, 450, 50, false);
  shape2.AddTextFrame("This is a sample of usual hyperlink.");
  shape2.TextFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkClick = new Hyperlink("https://www.aspose.com/");

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

ITextFrame.HighlightRegex method has been added

New HighlightRegex method has been added to ITextFrame interface and TextFrame class.

It allows to highlight text part with background color using regex, similar to Text Highlight Color tool in PowerPoint 2019.

/// <summary>
/// Highlight all matches of regular expression in text frame text using specified color.
/// </summary>
/// <param name="regex">Text of regular expression to get text to highlight.</param>
/// <param name="highlightColor">Highlighting color.</param>
/// <param name="options">Highlighting options.</param>
void HighlightRegex(string regex, Color highlightColor, ITextHighlightingOptions options);

The code snippet below shows how to use this feature:

Presentation presentation = new Presentation("SomePresentation.pptx");
TextHighlightingOptions options = new TextHighlightingOptions();
((AutoShape) presentation.Slides[0].Shapes[0]).TextFrame.HighlightRegex(@ "\b[^\s]{10,}\b", Color.LightGoldenrodYellow, options); // highlighting all words with 10 symbols or longer
presentation.Save("SomePresentation-out.pptx", SaveFormat.Pptx);

ITextFrame.HighlightText method has been added

New HighlightText method (+ overload) has been added to ITextFrame interface and TextFrame class. It allows to highlight text part with background color using text sample, similar to Text Highlight Color tool in PowerPoint 2019.

/// <summary>
/// Highlight all matches of sample in text frame text using specified color.
/// </summary>
/// <param name="text">Text sample to highlight.</param>
/// <param name="highlightColor">Highlighting color.</param>
void HighlightText(string text, Color highlightColor);

/// <summary>
/// Highlight all matches of sample in text frame text using specified color.
/// </summary>
/// <param name="text">Text sample to highlight.</param>
/// <param name="highlightColor">Highlighting color.</param>
/// <param name="options">Highlighting options.</param>
void HighlightText(string text, Color highlightColor, ITextHighlightingOptions options);

The code snippet below shows how to use this feature:

Presentation presentation = new Presentation("SomePresentation.pptx");
((AutoShape) presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("important", Color.LightBlue); // highlighting all words 'important'
((AutoShape) presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("the", Color.Violet, new TextHighlightingOptions() {
   WholeWordsOnly = true
}); // highlighting all separate 'the' occurrences
presentation.Save("SomePresentation-out.pptx", SaveFormat.Pptx); 

ITextHighlightingOptions interface and TextHighlightingOptions class have been added

Aspose.Slides.ITextHighlightingOptions interface and it’s implementation by Aspose.Slides.TextHighlightingOptions class have been added. They represent extra options for new TextFrame.HighlightText method.

There are 2 available options to specify:

/// <summary>
/// Set true to use case-sensitive search, false - otherwise.
/// </summary>
bool CaseSensitive { get; set; }

/// <summary>
/// Set true to match only whole words, false - otherwise.
/// </summary>
bool WholeWordsOnly { get; set; } 

New HyperlinkColorSource enum has been added

New Aspose.Slides.HyperlinkColorSource enum has been added. It represents different sources of hyperlink color.

HyperlinkColorSource enum has two members:

  • Styles: Hyperlink color is obtained from slide/presentation styles.
  • PortionFormat: Hyperlink color is obtained from PortionFormat properties (PortionFormat.FillFormat and PortionFormat.LineFormat).

New IResourceLoadingArgs interface has been added

New IResourceLoadingArgs interface has been added. This interface used for manage external resource loading arguments.

IResourceLoadingArgs interface has two properties:

/// <summary>
/// Original URI of the resource as specified in imported presentation. 
/// </summary>
string OriginalUri { get; }

/// <summary>
/// URI of the resource which is used for downloading if <see cref="IResourceLoadingCallback.ResourceLoading(IResourceLoadingArgs)"/> 
/// returns <see cref="ResourceLoadingAction.Default"/>. 
/// Initially it's set to original URI of the resource, but can be redefined to any value.
/// </summary>
string Uri { get; set; }

and one method:

/// <summary>
/// Sets user provided data of the resource which used if <see cref="IResourceLoadingCallback.ResourceLoading(IResourceLoadingArgs)"/> 
/// returns <see cref="ResourceLoadingAction.UserProvided"/>. 
/// </summary>
void SetData(byte[] data);

New IResourceLoadingCallback interface has been added

New IResourceLoadingCallback interface has been added.

This callback interface is used to manage external resources loading and has one method:

/// <summary>
/// Callback method which regulates external resources loading.
/// </summary>
/// <param name="args">The loading resource data <see cref="IResourceLoadingArgs"/>.</param>
/// <returns>The resource loading decision <see cref="ResourceLoadingAction"/>.</returns>
ResourceLoadingAction ResourceLoading(IResourceLoadingArgs args);

The code snippet below shows how to use IResourceLoadingCallback interface:

public void LoadPresentation() 
{
  LoadOptions opts = new LoadOptions();
  opts.ResourceLoadingCallback = new ImageLoadingHandler();
  Presentation presentation = new Presentation(path + "presentation.pptx", opts);
}

private class ImageLoadingHandler: IResourceLoadingCallback 
{
  public ResourceLoadingAction ResourceLoading(IResourceLoadingArgs args) 
  {
    if (args.OriginalUri.EndsWith(".jpg")) 
    {
      try // load substitute image
      {
        byte[] imageBytes = File.ReadAllBytes(Path.Combine(path, "aspose-logo.jpg"));
        args.SetData(imageBytes);
        return ResourceLoadingAction.UserProvided;
      } 
	  catch (Exception) 
	  {
        return ResourceLoadingAction.Skip;
      }
    } 
    else if (args.OriginalUri.EndsWith(".png")) 
    {
      // set substitute url
      args.Uri = "http://www.google.com/images/logos/ps_logo2.png";
      return ResourceLoadingAction.Default;
    }
    // skip all other images

	return ResourceLoadingAction.Skip;
  }
}

New ResourceLoadingAction enum has been added

ResourceLoadingAction enum has been added.

It specifies the mode of external resource loading and has three members:

  • Default: Aspose.Slides will load external resource as usual.
  • Skip: Aspose.Slides will skip loading of external resource. Only link without data will be stored for an image.
  • UserProvided: Aspose.Slides will use byte array provided by user in IResourceLoadingArgs.SetData(byte[]) as image data.

ResourceLoadingCallback property has been added to ILoadOptions interface and LoadOptions class

ResourceLoadingCallback property has been added to ILoadOptions interface and LoadOptions class.

This property represents the callback interface which manages external resources loading.

SvgResponsiveLayout property has been added to IHtmlOptions

SvgResponsiveLayout property has been added to Aspose.Slides.Export.IHtmlOptions interface.

/// <summary>
/// True to exclude width and height attributes from svg container - that will make layout responsive. False - otherwise.
/// Read/write <see cref="bool"/>.
/// </summary>
bool SvgResponsiveLayout { get; set; }

Code sample below shows how to export presentation to HTML with responsive layout:

Presentation presentation = new Presentation("SomePresentation.pptx");
HtmlOptions saveOptions = new HtmlOptions();
saveOptions.SvgResponsiveLayout = true;
presentation.Save("SomePresentation-out.html", SaveFormat.Html, saveOptions);

Note: While omitting width/height in SVG tag is enough for all modern browsers to layout result correctly, Internet Explorer requires additional CSS tweak. If you don’t use your custom HtmlFormatter for saving you don’t need to worry about this - Aspose.Slides adds this tweak automatically in that case.

But if you have your own HtmlFormatter and you want responsive HTML output to be IE-compatible, you need to embed the following CSS into the styles used in your custom HtmlFormatter:

svg 
{
  position: absolute;
  top: 0;
  left: 0;
}

.slide 
{
  position: relative;
  overflow: hidden;
  padding - top: XXX;
}

Where XXX is a percentage relation of your presentation slide height to width. For example, if you have usual landscape-oriented presentation with 16:9 slide size you need to specify padding-top: 56%. If you have album-oriented presentation with 3:4 slide size you need to specify padding-top: 133%.