Aspose.Slides for .NET 24.6 release (MSI installer) delivers many enhancements for developers working with presentations on the Windows platform. This version introduces refined text search functionality and highlighting capabilities for your presentation processing C# apps.
Powerful Text Search
Effortlessly locate specific text within your .NET presentations using the new ITextSearchOptions
interface introduced in this release. This update enables controlling aspects like whole word matches for precise searching, as showcased in the following C# code sample:
using (Presentation presentation = new Presentation("pres.pptx"))
{
presentation.ReplaceText("the", "***", new TextSearchOptions() {WholeWordsOnly = true}, null);
presentation.Save("pres-out.pptx", SaveFormat.Pptx);
}
Source*
Granular Highlighting
Achieve sophisticated highlighting effects with the introduction of ITextFrame.HighlightText
and ITextFrame.HighlightRegex
methods in this release of Aspose.Slides for .NET. You can now target specific text or utilize regular expressions for advanced highlighting. To learn how to highlight text in text frames, please refer to this code example:
using (Presentation presentation = new Presentation("pres.pptx"))
{
// highlighting all words 'important'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("important", Color.LightBlue);
// highlighting all separate 'the' occurrences
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("the", Color.Violet, new TextSearchOptions()
{ WholeWordsOnly = true }, null);
presentation.Save("pres-out2.pptx", SaveFormat.Pptx);
}
Source*
Text Replacement Flexibility
The addition of ITextFrame.ReplaceText
and ITextFrame.ReplaceRegex
methods in this release of the C# presentation API empower developers to efficiently replace text using regular expressions or whole word matching. Please check out the following code example, which demonstrates replacing text with the help of a regular expression:
/using (Presentation presentation = new Presentation("pres.pptx"))
{
Regex regex = new Regex(@"\b[^\s]{5,}\b");
// Replace all words with 10 or more characters with '***'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.ReplaceRegex(regex, "***", null);
presentation.Save("SomePresentation-out.pptx", SaveFormat.Pptx);
}
Source*
Control Over Gradients
We have introduced a new ISaveOption.GradientStyle
property in this version, which provides control over the visual rendering of two-color gradients while exporting presentations to images, as shown in this C# code sample:
using (Presentation pres = new Presentation("pres.pptx"))
{
RenderingOptions options = new RenderingOptions();
options.GradientStyle = GradientStyle.PowerPointUI;
IImage img = pres.Slides[0].GetImage(options, 2f, 2f);
}
Source*
Improved Text Handling
Various issues related to font changes, missing hyperlinks after text replacement, and highlighting functionality have been resolved in Aspose.Slides for .NET 24.6.
Enhanced Image Conversion
Image conversion functionality is also optimized in the latest library version by fixing incorrect background color rendering in PNG conversions.
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Slides for .NET 24.6 Release Notes.