Develop feature-rich presentation manipulation applications in Python with the latest release of Aspose.Slides for Python via .NET (v24.6, macOS x64). Update your apps with advanced text search, text highlighting/replacement, and more features on macOS x64 systems.
Supercharged Text Search
You can leverage the high-performance text search functionality for your presentations using the newly added ITextSearchOptions
interface in this Python PowerPoint API release and control whole-word matches. This code example illustrates how to use this feature.
import aspose.slides as slides
with slides.Presentation("pres.pptx") as presentation:
text_search_options = slides.TextSearchOptions()
text_search_options.whole_words_only = True
presentation.replace_text("the", "***", text_search_options, None)
presentation.save("pres-out.pptx", slides.export.SaveFormat.PPTX)
Source*
Add Text Highlighting Capability to Your Apps
Highlight text or regular expressions (Regex) in PowerPoint presentations using the latest release. The highlight_text
and highlight_regex
methods have been added to help you achieve this on MacOS x64. Please refer to the following code examples to learn how to use the feature.
Highlight text in a text frame:
import aspose.slides as slides
import aspose.pydrawing as drawing
with slides.Presentation("pres.pptx") as presentation:
# highlighting all words 'important'
presentation.slides[0].shapes[0].text_frame.highlight_text("important", drawing.Color.light_blue)
text_search_options = slides.TextSearchOptions()
text_search_options.whole_words_only = True
# highlighting all separate 'the' occurrences
presentation.slides[0].shapes[0].text_frame.highlight_text("the", drawing.Color.violet, text_search_options, None)
presentation.save("pres-out2.pptx", slides.export.SaveFormat.PPTX)
Source*
Highlight regex in a text frame:
import aspose.slides as slides
import aspose.pydrawing as drawing
with slides.Presentation("pres.pptx") as presentation:
# highlighting all words with 10 or more characters
presentation.slides[0].shapes[0].text_frame.highlight_regex(r"\b[^\s]{10,}\b", drawing.Color.blue)
presentation.save("SomePresentation-out.pptx", slides.export.SaveFormat.PPTX)
Source*
Text Replacement on Apple Mac
Aspose.Slides for Python via .NET (v24.6) lets you easily replace text or regular expressions in the whole of the presentation using the new IPresentation.replace_text()
and IPresentation.replace_regex()
methods. Check out the following code samples to learn how to add this functionality to your applications.
Replace text within a presentation.
import aspose.slides as slides
with slides.Presentation("SomePresentation.pptx") as presentation:
text_search_options = slides.TextSearchOptions()
text_search_options.whole_words_only = True
presentation.replace_text("the", "***", text_search_options, None)
presentation.save("SomePresentation-out2.pptx", slides.export.SaveFormat.PPTX)
Source*
Replace regex within a presentation.
import aspose.slides as slides
with slides.Presentation("SomePresentation.pptx") as presentation:
# Replace all words with 10 or more characters with '***'
presentation.replace_regex(r"\b[^\s]{10,}\b", "***")
presentation.save("SomePresentation-out.pptx", slides.export.SaveFormat.PPTX)
Source*
Finer Control Over Gradient Customization
The newly introduced gradient_style
property in ISaveOptions
allows you to control the visual appearance of two-color gradients in output presentation files on macOS x64 systems. This code example showcases how to add this functionality to your Python applications.
import aspose.slides as slides
with slides.Presentation("pres.pptx") as pres:
options = slides.export.RenderingOptions()
options.gradient_style = slides.GradientStyle.POWER_POINT_UI
img = pres.slides[0].get_image(options, 2, 2)
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting Aspose.Slides for Python via .NET 24.6 Release Notes.