Browse our Products

Aspose.Slides for .NET 17.9 Release Notes

KeySummaryCategory
SLIDESNET-38899Option for saving CSS and images separately when exporting as htmlFeature
SLIDESNET-39196Render notes when saving as HTMLFeature
SLIDESNET-39113Saving into HTML with preserving original fontsFeature
SLIDESNET-39090The possibility to specify fonts to process a single presentationEnhancement
SLIDESNET-39125The font has changed in the cloned presentationBug
SLIDESNET-39237Exporting PowerPoint files to PDF is x2 slower at leastBug
SLIDESNET-39281WordArt text differs from expectedBug
SLIDESNET-38015When PPTX is converted to PDF, the values in chart are missingBug
SLIDESNET-39279After open and save PPTX, output file returns an error for embedded PPTXBug
SLIDESNET-39302Arrow bullets get overlapped on text in generated PDFBug
SLIDESNET-39303Text is improperly rendered in generated PDFBug
SLIDESNET-39304Text position getting changed in generated PDF and thumbnailBug
SLIDESNET-39306Text (WordArt) is improperly rendered in thumbnailBug
SLIDESNET-39286Font file is locked after call to ClearCache methodBug
SLIDESNET-39312System.ArgumentException when converting specific PPTX to PPT or PPSBug
SLIDESNET-39133Exception on copying excel chart in pptBug
SLIDESNET-39221Border gets visible around placeholder in generated thumbnailsBug
SLIDESNET-39235Timed based animation on bullet effects are lost on cloning slidesBug
SLIDESNET-39276PPTX not properly converted to PDFBug
SLIDESNET-32445Missing image in exported slide SVG ImageBug
SLIDESNET-33962Text missing or improperly rendered in generated SVGBug
SLIDESNET-35966Axis Labels wrapping are not as in the generated PDF fileBug
SLIDESNET-37253Shadow effects lost in generated thumbnailBug
SLIDESNET-37609Footer and slide number are added to the first slide after loading and saving a pptBug
SLIDESNET-37680Shadow is added to Text after saving pptBug
SLIDESNET-37750Font position changes after saving pptBug
SLIDESNET-38552Font size changesBug
SLIDESNET-39054PptxRead exception on loading presentationBug
SLIDESNET-39108Unexpected text shadow effect shows upBug
SLIDESNET-39120Animation dimming effect missing after saving presentationBug
SLIDESNET-39129NotImplemented Exception is thrown on adding CategoryAxisType.AutoBug
SLIDESNET-39131ArgumentException on cloning slideBug
SLIDESNET-39142Shape becomes 3D after saving pptBug
SLIDESNET-39143Arrow shape is changed after saving pptBug
SLIDESNET-39149Image is not getting added for table cell in exported PDFBug
SLIDESNET-39163Animation effects are lost on saving presentationBug
SLIDESNET-39185Font exception on reading a presentation in Mono MAC OS environmentBug
SLIDESNET-39195PPTX not properly converted to PDFBug
SLIDESNET-39208Exception on loading presentationBug
SLIDESNET-39214Exception on loading presentationBug
SLIDESNET-39215PPT changed after saving: hyperlinks are goneBug
SLIDESNET-39222PptxRead exception on loading presentationBug
SLIDESNET-39225PptxReadException on reading presentationBug
SLIDESNET-39233Slides are rendered blank or with improper orientation in exported HTMLBug
SLIDESNET-39240Repair message on opening the Aspose.Slides saved presentation in MS 2010Bug
SLIDESNET-39243Arrow bullets get overlapped on text in PDFBug
SLIDESNET-39264Arrow bullets changed to square in saved presentationBug
SLIDESNET-39268Exception on saving presentationBug
SLIDESNET-39275InvalidOperationException on saving the presentationBug
SLIDESNET-39317Hyperlink with Japanese characters is converted to URL encodingBug

Public API Changes

Added possibility to specify fonts used with a presentation

A new DocumentLevelFontSources property has been added to ILoadOptions interface. It allows to specify external fonts that are used with the presentation.

DocumentLevelFontSources property is of type IFontSources that has the following properties:

  • string[] FontFolders - folders that are recursively searched for font files.
  • byte[][] MemoryFonts - a collection of fonts represented as byte arrays.
byte[] memoryFont1 = File.ReadAllBytes("customfonts\\CustomFont1.ttf");
byte[] memoryFont2 = File.ReadAllBytes("customfonts\\CustomFont2.ttf");
ILoadOptions loadOptions = new LoadOptions();
loadOptions.DocumentLevelFontSources.FontFolders = new string[] { "assets\\fonts", "global\\fonts" };
loadOptions.DocumentLevelFontSources.MemoryFonts = new byte[][] { memoryFont1, memoryFont2 };
using (IPresentation presentation = CreatePresentation("MyPresentation.pptx", loadOptions))
{
  //work with the presentation
  //CustomFont1, CustomFont2 as well as fonts from assets\fonts & global\fonts folders and their subfolders are available to the presentation
}

The fonts that are passed with DocumentLevelFontSources property are available to the presentation throughout its lifetime and are not available outside the presentation. Consider the following example:

string[] fontFolders1 = new string[] { "assets\\fonts" };
string[] fontFolders2 = new string[] { "global\\fonts" };

byte[] memoryFont1 = File.ReadAllBytes("customfonts\\CustomFont1.ttf");
byte[] memoryFont2 = File.ReadAllBytes("customfonts\\CustomFont2.ttf");

IFontSources fontSources1 = new FontSources { FontFolders = fontFolders1, MemoryFonts = new byte[][] { memoryFont1 } };
IFontSources fontSources2 = new FontSources { FontFolders = fontFolders2, MemoryFonts = new byte[][] { memoryFont2 } };

using (IPresentation presentation1 = CreatePresentation("MyPresentation1.pptx", new LoadOptions { DocumentLevelFontSources = fontSources1 }))
using (IPresentation presentation2 = CreatePresentation("MyPresentation2.pptx", new LoadOptions { DocumentLevelFontSources = fontSources2 }))
{
  //work with the presentations
  //CustomFont1 as well as fonts from assets\fonts folder and its subfolders are available to presentation1 but not to presentation2
  //CustomFont2 as well as fonts from global\fonts folder and its subfolders are available to presentation2 but not to presentation1
}

If you need to add external fonts at application level and make it available to all presentations please use FonsLoader class. You can use them together like as follows:

byte[] globalMemoryFont = File.ReadAllBytes("customfonts\\CustomFont1.ttf");
byte[] localMemoryFont = File.ReadAllBytes("customfonts\\CustomFont2.ttf");

ILoadOptions loadOptions = new LoadOptions();
loadOptions.DocumentLevelFontSources.FontFolders = new string[] { "assets\\fonts" };
loadOptions.DocumentLevelFontSources.MemoryFonts = new byte[][] { localMemoryFont };

using (IPresentation presentation = CreatePresentation("MyPresentation.pptx", loadOptions))
{
  //work with the presentation
  //CustomFont2 as well as fonts from assets\fonts folder and its subfolders are available to the presentation
  //CustomFont1 as well as fonts from global\fonts folder and its subfolders are unavailable to the presentation
}

FontsLoader.LoadExternalFonts(new string[] { "global\\fonts" });
FontsLoader.LoadExternalFont(globalMemoryFont);

using (IPresentation presentation = CreatePresentation("MyPresentation.pptx", loadOptions))
{
  //work with the presentation
  //CustomFont1 and CustomFont2 as well as fonts from global\fonts and assets\fonts folders and their subfolders are available to the presentation
}

CategoryAxisType.Auto value has been replaced with IAxis.SetCategoryAxisTypeAutomatically() method

Method IAxis.SetCategoryAxisTypeAutomatically() sets IAxis.CategoryAxisType property with a value that is automatically determined based on axis data.

Element HtmlNotes has been added to SaveFormat enumeration

Element HtmlNotes has been added to Aspose.Slides.Export.SaveFormat enumeration. This element allows saving presentation Notes Page View into HTML format.

Code example:

using (Presentation pres = new Presentation("Presentation.pptx"))
{
  // Saving notes pages
  pres.Save("Output.html", SaveFormat.HtmlNotes);
}

Obsolete Presentation.GetPresentationText methods have been deleted

Obsolete Presentation.GetPresentationText methods have been deleted:

Aspose.Slides.Presentation.GetPresentationText(Stream stream, TextExtractionArrangingMode mode)
Aspose.Slides.Presentation.GetPresentationText(String file, TextExtractionArrangingMode mode)
Aspose.Slides.Presentation.GetPresentationText(Stream stream, TextExtractionArrangingMode mode, LoadOptions options)

Write document elements methods have been made virtual in EmbedAllFontsHtmlController class. WriteAllFonts method has been Added.

WriteDocumentStart, WriteDocumentEnd, WriteSlideStart, WriteSlideEnd, WriteShapeStart, WriteShapeEnd methods have been made virtual to provide a better support to customize generated HTML documents.

In addition, WriteAllFonts method has been added. It allows overriding the way how all fonts contained in the presentation are serialized into HTML.

Please review the example how to use overridable methods to create a custom HTML document with a link to CSS file.

public class CustomHeaderAndFontsController : EmbedAllFontsHtmlController
{
  // Custom header template
  const string Header = +"<!DOCTYPE html>\n" +
      "<html>\n" +
	  "<head>\n" +
	  "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +
	  "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\">\n" +
	  "<link rel=\"stylesheet\" type=\"text/css\" href=\"{0}\">\n" +
	  "</head>";
	  
  private readonly string m_cssFileName;

  public CustomHeaderAndFontsController(string cssFileName)
  {
    m_cssFileName = cssFileName;
  }

  public override void WriteDocumentStart(IHtmlGenerator generator, IPresentation presentation)
  {
    generator.AddHtml(string.Format(Header, m_cssFileName));
    WriteAllFonts(generator, presentation);
  }

  public override void WriteAllFonts(IHtmlGenerator generator, IPresentation presentation)
  {
    generator.AddHtml("<!-- Embedded fonts -->");
    base.WriteAllFonts(generator, presentation);
  }
}

There is the example how CustomHeaderAndFontsController can be used.

using (Presentation pres = new Presentation("pres.pptx"))
{
  CustomHeaderAndFontsController htmlController = new CustomHeaderAndFontsController("styles.css");
  HtmlOptions options = new HtmlOptions
  {
    HtmlFormatter = HtmlFormatter.CreateCustomFormatter(htmlController),
  };
  
  pres.Save("pres.html", SaveFormat.Html, options);
}