Replace Text without Using a Storage

Introduction

You don’t need to upload files to storage to perform text replacement. You can use online methods to read a presentation from a request body and return an updated one in a response body. As with storage methods, Aspose.Slides Cloud provides methods to replace text on a specified slide or in the presentation as a whole. With online methods, the result of the operation is the updated presentation. The number of replacements is not returned. You need to use storage methods if replacement count is essential information for you.

ReplacePresentationTextOnline

API Information

API Type Description Resource
/slides/replaceText POST Replaces text within a presentation. ReplacePresentationTextOnline

Request Parameters

Name Type Location Required Description
document file formData true The presentation file.
oldValue string query true The text to be replaced.
newValue string query true The text to replace with.
ignoreCase boolean query false If true, the character case must be ignored. The default is false.
wholeWordsOnly boolean query false Indicates whether to replace only whole words that match the replace string. False by default.
password string header false The password to open the presentation.

In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.

Examples

Replace the word banana with the word orange in the document MyPresentation.pptx. Ignore the case of text characters.

cURL Solution

SDK Solutions

ReplacePresentationRegexOnline

API Information

API Type Description Resource
/slides/replaceRegex POST Replaces text in a presentation that matches a specified regular expression. ReplacePresentationRegexOnline

Request Parameters

Name Type Location Required Description
document file formData true The presentation file.
pattern string query true The regular expression to be replaced.
newValue string query true The text to replace with.
ignoreCase boolean query false If true, the character case must be ignored. The default is false.
password string header false The password to open the presentation.

In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.

Examples

Replace every occurence of hello, hi or hey with hola in the document MyPresentation.pptx. Ignore the case of text characters.

cURL Solution

SDK Solutions

ReplaceSlideTextOnline

API Information

API Type Description Resource
/slides/slides/{slideIndex}/replaceText POST Replaces text within a specified presentation slide. ReplaceSlideTextOnline

Request Parameters

Name Type Location Required Description
document file formData true The presentation file.
slideIndex integer path true The 1-based index of the slide.
oldValue string query true The text to be replaced.
newValue string query true The text to replace with.
ignoreCase boolean query false If true, the character case must be ignored. The default is false.
password string header false The password to open the presentation.

In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.

SDKs

Check Available SDKs to learn how to add an SDK to your project.